diff --git a/README.md b/README.md index f30b9b97..bc4eeabe 100644 --- a/README.md +++ b/README.md @@ -2,15 +2,12 @@ ```text [이클립스] -설정을 안하면 Could not resolve placeholder 'spring.profiles.active' in value -"classpath:logback-${spring.profiles.active}.xml" 오류 발생 - 프로젝트 우클릭 > Run As > Run Configurations > Arguments 탭 -> VM arguments에 -Dspring.profiles.active=local -Dfile.encoding=UTF8 추가 +> VM arguments에 -Dspring.config.activate.on-profile=local -Dfile.encoding=UTF8 추가 [인텔리제이] 1) 톰캣 vm 설정 -서버설정 > VM options에 -Dspring.profiles.active=local -Dfile.encoding=UTF8 추가 +서버설정 > VM options에 -Dspring.config.activate.on-profile=local -Dfile.encoding=UTF8 추가 2) 전역 vm 설정 Actions열기 > Edit Custom VM Options... 선택 > -Dfile.encoding=UTF8 추가 diff --git a/pom.xml b/pom.xml index c1f1370f..b3b47814 100644 --- a/pom.xml +++ b/pom.xml @@ -10,18 +10,12 @@ http://www.xit.co.kr - UTF-8 + UTF-8 17 - 5.3.20 - 4.1.0 + ${java.version} + ${java.version} + 3.0.5 - 2.6.11 - 1.2.9 - 1.7.32 - 3.5.5 - 2.13.5 - 2.0.6.RELEASE - ${project.build.directory}/generated-snippets @@ -44,161 +38,44 @@ cokr.xit.base - xit-foundation + xit-base 23.04.01-SNAPSHOT - jar - + - - org.egovframe.rte.fdl.logging - org.egovframe.rte - - + cokr.xit.base + xit-foundation + 23.04.01-SNAPSHOT - org.egovframe.rte - org.egovframe.rte.fdl.excel - ${org.egovframe.rte.version} - - - - commons-logging - commons-logging - - - org.egovframe.rte.fdl.logging - org.egovframe.rte - - - org.apache.logging.log4j - log4j-core - - - org.apache.logging.log4j - log4j-slf4j-impl - - - org.slf4j - log4j-over-slf4j - - - org.slf4j - jcl-over-slf4j - - - logback-core - ch.qos.logback - - - slf4j-api - org.slf4j - - - - - - - - - - - - - - - - - + cokr.xit.base + xit-user + 23.04.01-SNAPSHOT - org.egovframe.rte - org.egovframe.rte.ptl.mvc - ${org.egovframe.rte.version} - - - commons-logging - commons-logging - - - - org.egovframe.rte.fdl.logging - org.egovframe.rte - - + cokr.xit.base + xit-menu + 23.04.01-SNAPSHOT +--> - org.egovframe.rte - org.egovframe.rte.fdl.idgnr - ${org.egovframe.rte.version} - - - - commons-logging - commons-logging - - + org.mariadb.jdbc + mariadb-java-client + 2.7.2 - - org.springframework - spring-oxm - ${spring.maven.artifact.version} - - - commons-logging - commons-logging - - + org.junit.jupiter + junit-jupiter-engine + 5.9.2 + provided + javax.servlet javax.servlet-api @@ -225,859 +102,74 @@ 1.2.5 - - - io.springfox - springfox-swagger2 - 2.9.2 - - - slf4j-api - org.slf4j - - - spring-aop - org.springframework - - - spring-beans - org.springframework - - - spring-context - org.springframework - - - swagger-annotations - io.swagger - - - jackson-annotations - com.fasterxml.jackson.core - - - - - io.springfox - springfox-swagger-ui - 2.9.2 - - - io.swagger - swagger-annotations - 1.6.10 - - - - - org.thymeleaf - thymeleaf - 3.0.15.RELEASE - - - slf4j-api - org.slf4j - - - - - org.thymeleaf - thymeleaf-spring5 - 3.0.15.RELEASE - - - slf4j-api - org.slf4j - - - - - nz.net.ultraq.thymeleaf - thymeleaf-layout-dialect - 3.1.0 - - - - commons-dbcp - commons-dbcp - 1.4 - - - - cglib - cglib - 3.1 - - - - org.antlr - antlr - 3.5 - - - - org.apache.commons - commons-compress - 1.21 - - - - oro - oro - 2.0.8 - - - - - - - com.jcraft - jsch - 0.1.54 - - - - - org.mariadb.jdbc - mariadb-java-client - 2.7.2 - - - - - - - - - - - - - - - - - org.bgee.log4jdbc-log4j2 - log4jdbc-log4j2-jdbc4.1 - 1.16 - - - - commons-fileupload - commons-fileupload - 1.5 - - - - - org.projectlombok - lombok - 1.18.22 - provided - - - - - com.ibm.icu - icu4j - 53.1 - - - - - org.quartz-scheduler - quartz - 2.3.2 - - - slf4j-api - org.slf4j - - - - - - - - - - - - - - com.googlecode.json-simple - json-simple - 1.1.1 - - - - org.codehaus.jettison - jettison - 1.5.4 - - - - - - org.apache.tiles tiles-jsp ${org.apache.tiles.version} - - - slf4j-api - org.slf4j - - - - - - org.apache.tiles - tiles-extras - ${org.apache.tiles.version} - - - slf4j-api - org.slf4j - - - guava - com.google.guava - - - commons-digester - commons-digester - - - jcl-over-slf4j - org.slf4j - - - ognl - ognl - - - spring-web - org.springframework - - - commons-collections - commons-collections - - - commons-lang - commons-lang - - - - - - - - - - - - - - - org.apache.commons - commons-email - 1.5 - - - egovframework.com.ems - sndng-mail - 1.0 - - - - - - - com.fasterxml.jackson.core - jackson-core - ${fasterxml.jackson.version} - - - com.fasterxml.jackson.core - jackson-databind - ${fasterxml.jackson.version} - - - com.fasterxml.jackson.module - jackson-module-parameter-names - ${fasterxml.jackson.version} - - - com.fasterxml.jackson.module - jackson-module-afterburner - ${fasterxml.jackson.version} - - - com.fasterxml.jackson.dataformat - jackson-dataformat-xml - ${fasterxml.jackson.version} - - - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - ${fasterxml.jackson.version} - - - com.fasterxml.jackson.datatype - jackson-datatype-joda - ${fasterxml.jackson.version} - - - - - - com.google.code.gson - gson - 2.9.0 - - - - org.apache.poi - poi - 5.2.2 - - - org.apache.poi - poi-ooxml - 5.2.2 - - - org.apache.commons - commons-collections4 - 4.1 - - - - - commons-configuration - commons-configuration - 1.10 - - - - commons-lang - commons-lang - 2.6 - - - org.springmodules - spring-modules-jakarta-commons - 0.8a - - - jstl - javax.servlet - - - javax.servlet - servlet-api - - - org.springframework - spring-support - - - org.springframework - spring-beans - - - org.springframework - spring-web - - - commons-beanutils - commons-beanutils - - - commons-digester - commons-digester - - - commons-logging - commons-logging - - - commons-configuration - commons-configuration - - - commons-lang - commons-lang - - - commons-validator - commons-validator - - - spring-context - org.springframework - - - spring-core - org.springframework - - - spring-webmvc - org.springframework - - - commons-codec - commons-codec - - - commons-collections - commons-collections - - - commons-fileupload - commons-fileupload - - - - - - - - - - - net.sf.ehcache - ehcache-core - 2.6.11 - - - commons-logging - commons-logging - - - slf4j-api - org.slf4j - - + org.springframework + spring-aop + 5.3.20 org.springframework - spring-context-support - ${spring.maven.artifact.version} + spring-beans + 5.3.20 - - - - - ch.qos.logback - logback-classic - ${logback.version} + org.springframework + spring-context + 5.3.20 - org.slf4j - jul-to-slf4j - 1.7.32 + org.springframework + spring-core + 5.3.20 - org.logback-extensions - logback-ext-spring - 0.1.5 - - - ch.qos.logback - logback-classic - - + org.springframework + spring-expression + 5.3.20 - org.slf4j - jcl-over-slf4j - ${slf4j.version} - - - org.slf4j - slf4j-api - - + org.springframework + spring-web + 5.3.20 - org.slf4j - slf4j-api - ${slf4j.version} + org.egovframe.rte + org.egovframe.rte.fdl.cmmn + 4.1.0 - - - - - org.json - json - 20220924 + org.egovframe.rte + org.egovframe.rte.fdl.idgnr + 4.1.0 - - - org.springframework.restdocs - spring-restdocs-mockmvc - ${spring.rest-doc.version} - test - - - spring-test - org.springframework - - - spring-webmvc - org.springframework - - - javax.servlet-api - javax.servlet - - - jackson-databind - com.fasterxml.jackson.core - - - spring-web - org.springframework - - - - - - - - javax.xml.bind - jaxb-api - 2.3.1 - - - - - org.apache.cxf - cxf-rt-frontend-jaxrs - ${apache.cxf.version} - - - org.apache.cxf - cxf-rt-transports-http - ${apache.cxf.version} - - - wsdl4j - wsdl4j - 1.6.2 - - - - - - - - org.jasypt - jasypt-spring31 - 1.9.3 - - - org.projectlombok - lombok - 1.18.22 - compile - - install - ${basedir}/target fims - - - src/main/resources - - *.properties - *-${env}.xml - **/${env}/* - message/**/* - spring/*.xml - spring/*/*.xml - sql/mybatis-config.xml - sql/mapper/**/* - validator/**/* - template/**/* - templates/thymeleaf/**/* - - true - - - - - - - org.apache.maven.plugins - maven-war-plugin - 3.3.2 - - - maven-resources-plugin - - - copy-resources - - validate - - copy-resources - - - ${basedir}/target/dockerfile - - - src/main/docker - true - - - - - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - ${java-version} - ${java-version} - ${encoding} - - - - - - org.codehaus.mojo - emma-maven-plugin - 1.0-alpha-3 - - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.12.4 - - true - once - xml - - **/Abstract*.java - **/*Suite.java - - - **/*Test.java - - - - - org.codehaus.mojo - emma-maven-plugin - true - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.9.1 - - - - - - org.asciidoctor - asciidoctor-maven-plugin - 1.5.8 - - - generate-docs - - prepare-package - - process-asciidoc - - - html - book - - ${snippetsDirectory} - - ${basedir}/src/main/docs/asciidocs - ${project.build.directory}/generated-docs - - - - - - - org.springframework.restdocs - spring-restdocs-asciidoctor - ${spring.rest-doc.version} - - + org.apache.maven.plugins + maven-war-plugin + 3.3.2 - - - - - - - - maven-resources-plugin - 2.7 - - - copy-resources - prepare-package - - copy-resources - - - - - ${project.build.outputDirectory}/static/docs - - - - - ${project.build.directory}/generated-docs - - - - - - - - - - + + diff --git a/src/main/java/cokr/xit/app/MainController.java b/src/main/java/cokr/xit/app/MainController.java new file mode 100644 index 00000000..88736eed --- /dev/null +++ b/src/main/java/cokr/xit/app/MainController.java @@ -0,0 +1,38 @@ +package cokr.xit.app; + +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.servlet.ModelAndView; +import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping; + +import cokr.xit.foundation.data.DataObject; +import cokr.xit.foundation.web.AbstractController; +import cokr.xit.foundation.web.RequestHandlerReader; + +@Controller +public class MainController extends AbstractController { + @Autowired + private RequestMappingHandlerMapping requestHandlers; + + @GetMapping(name="로그인", value="/login.do") + public String loginPage() { + return "login"; + } + + @GetMapping(name="홈", value={"/", "/index.do"}) + public ModelAndView mainPage() { + return new ModelAndView("index"); + } + + @RequestMapping(name="기능 URL 선택", value="/urls.do") + public ModelAndView getURLs(boolean multiple) { + List urls = new RequestHandlerReader().read(requestHandlers); + return new ModelAndView("select-url") + .addObject("multiple", multiple) + .addObject("urls", toJson(urls)); + } +} \ No newline at end of file diff --git a/src/main/java/cokr/xit/app/base/ActionGroupController.java b/src/main/java/cokr/xit/app/base/ActionGroupController.java new file mode 100644 index 00000000..4fa417ae --- /dev/null +++ b/src/main/java/cokr/xit/app/base/ActionGroupController.java @@ -0,0 +1,7 @@ +package cokr.xit.app.base; + +import org.springframework.stereotype.Controller; + +@Controller +public class ActionGroupController extends cokr.xit.base.security.access.web.ActionGroupController { +} \ No newline at end of file diff --git a/src/main/java/cokr/xit/app/base/AuthorityController.java b/src/main/java/cokr/xit/app/base/AuthorityController.java new file mode 100644 index 00000000..b4c48cd5 --- /dev/null +++ b/src/main/java/cokr/xit/app/base/AuthorityController.java @@ -0,0 +1,7 @@ +package cokr.xit.app.base; + +import org.springframework.stereotype.Controller; + +@Controller +public class AuthorityController extends cokr.xit.base.security.access.web.AuthorityController { +} \ No newline at end of file diff --git a/src/main/java/cokr/xit/app/base/CodeController.java b/src/main/java/cokr/xit/app/base/CodeController.java new file mode 100644 index 00000000..65cccb00 --- /dev/null +++ b/src/main/java/cokr/xit/app/base/CodeController.java @@ -0,0 +1,6 @@ +package cokr.xit.app.base; + +import org.springframework.stereotype.Controller; + +@Controller +public class CodeController extends cokr.xit.base.code.web.CodeController {} \ No newline at end of file diff --git a/src/main/java/cokr/xit/app/base/FileController.java b/src/main/java/cokr/xit/app/base/FileController.java new file mode 100644 index 00000000..ce997a60 --- /dev/null +++ b/src/main/java/cokr/xit/app/base/FileController.java @@ -0,0 +1,8 @@ +package cokr.xit.app.base; + +import org.springframework.stereotype.Controller; + +@Controller +public class FileController extends cokr.xit.base.file.web.FileController { + +} diff --git a/src/main/java/cokr/xit/app/base/MenuController.java b/src/main/java/cokr/xit/app/base/MenuController.java new file mode 100644 index 00000000..9d1236ef --- /dev/null +++ b/src/main/java/cokr/xit/app/base/MenuController.java @@ -0,0 +1,7 @@ +package cokr.xit.app.base; + +import org.springframework.stereotype.Controller; + +@Controller +public class MenuController extends cokr.xit.base.menu.web.MenuController { +} \ No newline at end of file diff --git a/src/main/java/cokr/xit/app/base/UserController.java b/src/main/java/cokr/xit/app/base/UserController.java new file mode 100644 index 00000000..6deaf056 --- /dev/null +++ b/src/main/java/cokr/xit/app/base/UserController.java @@ -0,0 +1,9 @@ +package cokr.xit.app.base; + +import org.springframework.stereotype.Controller; + +import cokr.xit.base.user.ManagedUser; + +@Controller +public class UserController extends cokr.xit.base.user.web.UserController { +} \ No newline at end of file diff --git a/src/main/java/cokr/xit/fims/biz/cmm/service/bean/FimsCrackdownMgtServiceBean.java b/src/main/java/cokr/xit/fims/biz/cmm/service/bean/FimsCrackdownMgtServiceBean.java index 7944d738..abf84f22 100644 --- a/src/main/java/cokr/xit/fims/biz/cmm/service/bean/FimsCrackdownMgtServiceBean.java +++ b/src/main/java/cokr/xit/fims/biz/cmm/service/bean/FimsCrackdownMgtServiceBean.java @@ -50,17 +50,16 @@ import javax.annotation.Resource; @RequiredArgsConstructor @Service public class FimsCrackdownMgtServiceBean extends AbstractServiceBean implements FimsCrackdownMgtService { - @Value("#{prop['file.res.root']}") - private String uploadResPath; - @Value("#{prop['file.upload.root']}") - private String uploadRootPath; + private String uploadResPath = "/data/fims/extnl/rcv"; - @Value("#{prop['file.snd.path']}") - private String sendFilePath; + private String uploadRootPath ="/data/fims/upload"; - @Value("#{prop['file.upload.temp.path']}") - private String uploadTempPath; + + private String sendFilePath = "/data/fims/SND"; + + + private String uploadTempPath = "/temp"; @Resource(name = "xitFrameCodeService") private XitFrameCodeService xitFrameCodeService; diff --git a/src/main/java/cokr/xit/fims/biz/cmm/web/FimsCrackDownMgtController.java b/src/main/java/cokr/xit/fims/biz/cmm/web/FimsCrackDownMgtController.java index 46134503..ccd17b66 100644 --- a/src/main/java/cokr/xit/fims/biz/cmm/web/FimsCrackDownMgtController.java +++ b/src/main/java/cokr/xit/fims/biz/cmm/web/FimsCrackDownMgtController.java @@ -23,7 +23,6 @@ import cokr.xit.fims.biz.rt.service.RtCrackdownMgtService; import cokr.xit.fims.biz.utils.FimsBizUtils; import cokr.xit.fims.framework.biz.cmm.service.CmmFileService; import cokr.xit.fims.framework.core.constants.FrameworkConstants; -import cokr.xit.fims.framework.core.ResultResponse; import cokr.xit.fims.framework.support.mybatis.MybatisUtils; import cokr.xit.fims.framework.support.util.AjaxMessageMapRenderer; import cokr.xit.fims.framework.support.util.constants.MessageKey; @@ -38,14 +37,14 @@ import lombok.extern.slf4j.Slf4j; @Controller @RequestMapping(name = "", value = "/fims/{biz}/cmm") public class FimsCrackDownMgtController extends AbstractController { - @Value("#{prop['file.rcv.root']}") - private String fileRcvRoot; - @Value("#{prop['file.rcv.businstall-cctv.path']}") - private String rcvBusinstallCctvPath; - @Value("#{prop['file.rcv.natl-newspaper.path']}") - private String rcvNatlNewspaperPath; - @Value("#{prop['app.extnl.car.url']}") - private String extnlCarUrl; + + private String fileRcvRoot = "/data/fims/extnl/rcv"; + + private String rcvBusinstallCctvPath = "/businstall"; + + private String rcvNatlNewspaperPath ="/natl-newspaper"; + + private String extnlCarUrl = "http://211.119.124.9:18090"; private final FimsCrackdownMgtService service; private final RtCrackdownMgtService rtService; @@ -157,13 +156,9 @@ public class FimsCrackDownMgtController extends AbstractController { @RequestMapping(name = "", value = "/findCrackdownInfos") public ModelAndView findCrackdownInfos(@RequestParam final Map paraMap) { - return ResultResponse.of(service.findCrackdownInfos(paraMap, MybatisUtils.getPagingInfo(paraMap))); + return new ModelAndView("jsonView").addObject("result",service.findCrackdownInfos(paraMap, MybatisUtils.getPagingInfo(paraMap))); } - // @RequestMapping(name = "", value = "/findCrackdownInfo") - // public ModelAndView findCrackdownInfo(final FimsCrackdownDTO.Request dto){ - // return ResultResponse.of(service.findCrackdownInfo(dto)); - // } @RequestMapping(name = "", value = "/findCrackdownInfoAndAttchFiles") public ModelAndView findCrackdownInfoAndAttchFiles(final FimsCrackdownDTO.Request dto) { @@ -178,7 +173,7 @@ public class FimsCrackDownMgtController extends AbstractController { @RequestMapping(name = "", value = "/findRcvPathFiles") public ModelAndView findRcvPathFiles(final String dirPath){ - return ResultResponse.of(FimsBizUtils.getRcvPathFiles(dirPath)); + return new ModelAndView("jsonView").addObject("result",FimsBizUtils.getRcvPathFiles(dirPath)); } /** @@ -218,7 +213,7 @@ public class FimsCrackDownMgtController extends AbstractController { @RequestMapping(name = "", value = "/findCtznStmtAnswer") public ModelAndView findCtznStmtAnswer(final FimsCrackdownDTO.AnsRequest dto){ - return ResultResponse.of(service.findCtznStmtAnswer(dto)); + return new ModelAndView("jsonView").addObject("result",service.findCtznStmtAnswer(dto)); } @PostMapping(name = "", value = "/modifyCtznStmtAnswer") @@ -232,7 +227,7 @@ public class FimsCrackDownMgtController extends AbstractController { @RequestMapping(name = "", value = "/addCtznStmtAnswer") public ModelAndView addCtznStmtAnswer(final String interfaceSeqN) { - return ResultResponse.of(service.addCtznStmtAnswer(interfaceSeqN)); + return new ModelAndView("jsonView").addObject("result",service.addCtznStmtAnswer(interfaceSeqN)); } @RequestMapping(name = "", value = "/addCtznStmtAnswers") @@ -245,27 +240,27 @@ public class FimsCrackDownMgtController extends AbstractController { @RequestMapping(name = "", value = "/findCtznAnswerTmplInfo") public ModelAndView findCtznAnswerTmplInfo(final FimsCrackdownDTO.AnsRequest dto){ - return ResultResponse.of(service.findCtznAnswerTmplInfo(dto)); + return new ModelAndView("jsonView").addObject("result",service.findCtznAnswerTmplInfo(dto)); } @RequestMapping(name = "", value = "/findProcessSttusChangeHist") public ModelAndView findProcessSttusChangeHist(final FimsCrackdownDTO.AnsRequest dto){ - return ResultResponse.of(service.findProcessSttusChangeHist(dto)); + return new ModelAndView("jsonView").addObject("result",service.findProcessSttusChangeHist(dto)); } @RequestMapping(name = "", value = "/findRtpyrAdresHist") public ModelAndView findRtpyrAdresHist(final FimsCrackdownDTO.AnsRequest dto){ - return ResultResponse.of(service.findRtpyrAdresHist(dto)); + return new ModelAndView("jsonView").addObject("result",service.findRtpyrAdresHist(dto)); } @RequestMapping(name = "", value = "/findElctrnNticSndng") public ModelAndView findElctrnNticSndng(final FimsCrackdownDTO.AnsRequest dto){ - return ResultResponse.of(service.findElctrnNticSndng(dto)); + return new ModelAndView("jsonView").addObject("result",service.findElctrnNticSndng(dto)); } @RequestMapping(name = "", value = "/findCtznSttemntCmplt") public ModelAndView findCtznSttemntCmplt(final FimsCrackdownDTO.CtznSttemntCmplt dto){ - return ResultResponse.of(service.findCtznSttemntCmplt(dto)); + return new ModelAndView("jsonView").addObject("result",service.findCtznSttemntCmplt(dto)); } @RequestMapping(name = "", value = "/addCtznSttemntCmplt") @@ -278,7 +273,7 @@ public class FimsCrackDownMgtController extends AbstractController { @RequestMapping(name = "", value = "/findCrackdownVhrnoCnt") public ModelAndView findCrackdownVhrnoCnt(final String vhrno){ - return ResultResponse.of(service.findCrackdownVhrnoCnt(vhrno)); + return new ModelAndView("jsonView").addObject("result",service.findCrackdownVhrnoCnt(vhrno)); } /** @@ -292,7 +287,7 @@ public class FimsCrackDownMgtController extends AbstractController { */ @RequestMapping(name = "", value = "/sendCrackdownPhotoToNtri") public ModelAndView sendCrackdownPhotoToNtri(@RequestBody final List dtoList){ - return ResultResponse.of(service.sendCrackdownPhotoToNtri(dtoList)); + return new ModelAndView("jsonView").addObject("result",service.sendCrackdownPhotoToNtri(dtoList)); } } diff --git a/src/main/java/cokr/xit/fims/biz/ec/service/bean/EcCctvCrackdownServiceBean.java b/src/main/java/cokr/xit/fims/biz/ec/service/bean/EcCctvCrackdownServiceBean.java index 045adc3b..47f1496d 100644 --- a/src/main/java/cokr/xit/fims/biz/ec/service/bean/EcCctvCrackdownServiceBean.java +++ b/src/main/java/cokr/xit/fims/biz/ec/service/bean/EcCctvCrackdownServiceBean.java @@ -48,23 +48,20 @@ import javax.annotation.Resource; @Service public class EcCctvCrackdownServiceBean extends AbstractServiceBean implements EcCctvCrackdownService { - @Value("#{prop['file.upload.root']}") - private String uploadRoot; + private String uploadRoot = "/data/fims/upload"; - @Value("#{prop['file.upload.temp.path']}") - private String uploadTempPath; + private String uploadTempPath = "/temp"; - @Value("#{prop['file.upload.cctv-fix.path']}") - private String uploadCctvFixPath; - @Value("#{prop['file.upload.cctv-drv.path']}") - private String uploadCctvDrvPath; + private String uploadCctvFixPath = "/cctv-fix"; - @Value("#{prop['file.upload.businstall-cctv.path']}") - private String uploadBusCctvPath; + private String uploadCctvDrvPath = "/cctv-drv"; - @Value("#{prop['file.rcv.backup.root']}") - private String rcvBackupRoot; + + private String uploadBusCctvPath = "/businstall"; + + + private String rcvBackupRoot = "/data/fims/extnl/backup"; private final EcCctvCrackdownMapper mapper; private final EcCtznSttemntMapper ctznSttemntMapper; diff --git a/src/main/java/cokr/xit/fims/biz/ec/service/bean/EcCtznSttemntServiceBean.java b/src/main/java/cokr/xit/fims/biz/ec/service/bean/EcCtznSttemntServiceBean.java index bad5db28..82821681 100644 --- a/src/main/java/cokr/xit/fims/biz/ec/service/bean/EcCtznSttemntServiceBean.java +++ b/src/main/java/cokr/xit/fims/biz/ec/service/bean/EcCtznSttemntServiceBean.java @@ -37,14 +37,9 @@ import javax.annotation.Resource; @Service public class EcCtznSttemntServiceBean extends AbstractServiceBean implements EcCtznSttemntService { - @Value("#{prop['file.upload.root']}") - private String uploadRoot; - @Value("#{prop['file.upload.natl-newspaper.path']}") - private String uploadNewsPaperPath; - @Value("#{prop['file.res.root']}") - private String uploadResPath; + private String uploadResPath = "/data/fims/extnl/res"; private final EcCtznSttemntMapper mapper; diff --git a/src/main/java/cokr/xit/fims/biz/ec/service/bean/EcNatlNewspaperServiceBean.java b/src/main/java/cokr/xit/fims/biz/ec/service/bean/EcNatlNewspaperServiceBean.java index a98e82d9..8d76b633 100644 --- a/src/main/java/cokr/xit/fims/biz/ec/service/bean/EcNatlNewspaperServiceBean.java +++ b/src/main/java/cokr/xit/fims/biz/ec/service/bean/EcNatlNewspaperServiceBean.java @@ -56,14 +56,13 @@ import javax.annotation.Resource; @Service public class EcNatlNewspaperServiceBean extends AbstractServiceBean implements EcNatlNewspaperService { - @Value("#{prop['file.upload.root']}") - private String uploadRoot; + private String uploadRoot = "/data/fims/upload"; - @Value("#{prop['file.upload.natl-newspaper.path']}") - private String uploadNewsPaperPath; - @Value("#{prop['file.rcv.backup.root']}") - private String rcvBackupRoot; + private String uploadNewsPaperPath = "/natl-newspaper"; + + + private String rcvBackupRoot = "/data/fims/extnl/backup"; @Resource(name = "xitFrameCodeService") private XitFrameCodeService xitFrameCodeService; diff --git a/src/main/java/cokr/xit/fims/biz/ec/web/EcCctvCrackdownController.java b/src/main/java/cokr/xit/fims/biz/ec/web/EcCctvCrackdownController.java index b5c71e66..6866ede8 100644 --- a/src/main/java/cokr/xit/fims/biz/ec/web/EcCctvCrackdownController.java +++ b/src/main/java/cokr/xit/fims/biz/ec/web/EcCctvCrackdownController.java @@ -22,7 +22,7 @@ import cokr.xit.fims.biz.utils.FimsBizUtils; import cokr.xit.fims.framework.biz.cmm.CmmFileDTO; import cokr.xit.fims.framework.biz.cmm.service.CmmFileService; import cokr.xit.fims.framework.core.constants.FrameworkConstants; -import cokr.xit.fims.framework.core.ResultResponse; + import cokr.xit.fims.framework.support.mybatis.MybatisUtils; import cokr.xit.fims.framework.support.util.AjaxMessageMapRenderer; import cokr.xit.fims.framework.support.util.constants.MessageKey; @@ -34,13 +34,9 @@ import lombok.extern.slf4j.Slf4j; @Controller @RequestMapping(name = "", value = "/fims/{biz}/ec") public class EcCctvCrackdownController extends AbstractController { - @Value("#{prop['file.rcv.root']}") - private String fileRcvRoot; - @Value("#{prop['file.rcv.businstall-cctv.path']}") - private String rcvBusinstallCctvPath; - @Value("#{prop['file.rcv.natl-newspaper.path']}") - private String rcvNatlNewspaperPath; + + private final EcCctvCrackdownService service; private final CmmFileService fileService; @@ -50,7 +46,7 @@ public class EcCctvCrackdownController extends AbstractController { @GetMapping(name = "", value = "/findExtrlRegltCntcs") public ModelAndView findExtrlRegltCntcs(@RequestParam final Map paraMap) { - return ResultResponse.of(service.findExtrlRegltCntcs(paraMap, MybatisUtils.getPagingInfo(paraMap))); + return new ModelAndView("jsonView").addObject("result",service.findExtrlRegltCntcs(paraMap, MybatisUtils.getPagingInfo(paraMap))); } @RequestMapping(name = "", value = "/findExtrlRegltCntcAndAttchFiles") @@ -67,7 +63,7 @@ public class EcCctvCrackdownController extends AbstractController { @RequestMapping(name = "", value = "/findExtrlRegltCntc") public ModelAndView findExtrlRegltCntc(final CctvCrackdownDTO.Request dto) { - return ResultResponse.of("extrDTO", service.findExtrlRegltCntc(dto)); + return new ModelAndView("jsonView").addObject("result", service.findExtrlRegltCntc(dto)); } @PostMapping(name = "", value = "/saveCctvCrackdownDatas") @@ -133,12 +129,12 @@ public class EcCctvCrackdownController extends AbstractController { @Deprecated @RequestMapping(name = "", value = "/findBusCctvCrackdownFiles") public ModelAndView findBusCctvCrackdownFiles(final String dirPath){ - return ResultResponse.of(FimsBizUtils.getRcvPathFiles(dirPath)); + return new ModelAndView("jsonView").addObject("result",FimsBizUtils.getRcvPathFiles(dirPath)); } @RequestMapping(name = "", value = "/findExtrlRegltCntcAttchFiles") public ModelAndView findExtrlRegltCntcAttchFiles(final String fileLinkId, final String crdnSeCd) { - return ResultResponse.of( + return new ModelAndView("jsonView").addObject("result", fileService.findFilesByInfTypeAndInfKey( CmmFileDTO.FileMst.builder() .infType(FimsBizUtils.getFileInfType(crdnSeCd)) @@ -151,7 +147,7 @@ public class EcCctvCrackdownController extends AbstractController { @RequestMapping(name = "", value = "/sendEcExtrlCrackdownRespons") public ModelAndView sendEcExtrlCrackdownRespons(final String fileLinkId, final String crdnSeCd) { - return ResultResponse.of( + return new ModelAndView("jsonView").addObject("result", fileService.findFilesByInfTypeAndInfKey( CmmFileDTO.FileMst.builder() .infType(FimsBizUtils.getFileInfType(crdnSeCd)) diff --git a/src/main/java/cokr/xit/fims/biz/ec/web/EcCtznSttemntController.java b/src/main/java/cokr/xit/fims/biz/ec/web/EcCtznSttemntController.java index 466c990e..a2cf1df2 100644 --- a/src/main/java/cokr/xit/fims/biz/ec/web/EcCtznSttemntController.java +++ b/src/main/java/cokr/xit/fims/biz/ec/web/EcCtznSttemntController.java @@ -20,7 +20,7 @@ import cokr.xit.fims.biz.ec.service.EcCtznSttemntService; import cokr.xit.fims.framework.biz.cmm.CmmFileDTO; import cokr.xit.fims.framework.biz.cmm.service.CmmFileService; import cokr.xit.fims.framework.core.constants.FrameworkConstants; -import cokr.xit.fims.framework.core.ResultResponse; + import cokr.xit.fims.framework.support.mybatis.MybatisUtils; import cokr.xit.fims.framework.support.util.AjaxMessageMapRenderer; import cokr.xit.fims.framework.support.util.constants.MessageKey; @@ -32,11 +32,7 @@ import lombok.extern.slf4j.Slf4j; @Controller @RequestMapping(name = "", value = "/fims/{biz}/ec") public class EcCtznSttemntController extends AbstractController { - @Value("#{prop['file.rcv.root']}") - private String fileRcvRoot; - @Value("#{prop['file.rcv.natl-newspaper.path']}") - private String rcvNatlNewspaperPath; private final EcCtznSttemntService service; private final CmmFileService fileService; @@ -65,17 +61,17 @@ public class EcCtznSttemntController extends AbstractController { @GetMapping(name = "", value = "/findCtznStmts") public ModelAndView findCtznStmts(@RequestParam final Map paraMap) { - return ResultResponse.of(service.findCtznStmts(paraMap, MybatisUtils.getPagingInfo(paraMap))); + return new ModelAndView("jsonView").addObject("result",service.findCtznStmts(paraMap, MybatisUtils.getPagingInfo(paraMap))); } @RequestMapping (value = "/findCtznStmtDtls") public ModelAndView findCtznStmtDtls(final CtznStmtDTO.Request dto) { - return ResultResponse.of(service.findCtznStmtDtls(dto)); + return new ModelAndView("jsonView").addObject("result",service.findCtznStmtDtls(dto)); } @GetMapping(name = "", value = "/findCtznStmtDtl") public ModelAndView findCtznStmtDtl(final CtznStmtDTO.Request dto) { - return ResultResponse.of(service.findCtznStmtDtl(dto)); + return new ModelAndView("jsonView").addObject("result",service.findCtznStmtDtl(dto)); } @RequestMapping(name = "", value = "/findCtznStmtDtlAndAttchFiles") @@ -95,7 +91,7 @@ public class EcCtznSttemntController extends AbstractController { @RequestMapping(name = "", value = "/findCtznStmtAttchFiles") public ModelAndView findCtznStmtAttchFiles(final CtznStmtDTO.Request dto) { - return ResultResponse.of( + return new ModelAndView("jsonView").addObject("result", fileService.findFilesByEsbInterfaces( CmmFileDTO.FileMst.builder() .infType(FimsConst.FileInfType.NATL_NEWS_PAPER_RCV.getCode()) @@ -147,6 +143,6 @@ public class EcCtznSttemntController extends AbstractController { @RequestMapping(name = "", value = "/saveCtznStmtAns") public ModelAndView saveCtznStmtAns(final CtznStmtDTO.Ans dto) { - return ResultResponse.of(service.saveCtznStmtAns(dto)); + return new ModelAndView("jsonView").addObject("result",service.saveCtznStmtAns(dto)); } } diff --git a/src/main/java/cokr/xit/fims/biz/ec/web/EcNatlNewspaperController.java b/src/main/java/cokr/xit/fims/biz/ec/web/EcNatlNewspaperController.java index 88626774..79b5a5a2 100644 --- a/src/main/java/cokr/xit/fims/biz/ec/web/EcNatlNewspaperController.java +++ b/src/main/java/cokr/xit/fims/biz/ec/web/EcNatlNewspaperController.java @@ -21,7 +21,7 @@ import cokr.xit.fims.biz.utils.FimsBizUtils; import cokr.xit.fims.framework.biz.cmm.CmmFileDTO; import cokr.xit.fims.framework.biz.cmm.service.CmmFileService; import cokr.xit.fims.framework.core.constants.FrameworkConstants; -import cokr.xit.fims.framework.core.ResultResponse; + import cokr.xit.fims.framework.support.mybatis.MybatisUtils; import cokr.xit.fims.framework.support.util.AjaxMessageMapRenderer; import cokr.xit.fims.framework.support.util.constants.MessageKey; @@ -33,11 +33,7 @@ import lombok.extern.slf4j.Slf4j; @Controller @RequestMapping(name = "", value = "/fims/{biz}/ec") public class EcNatlNewspaperController extends AbstractController { - @Value("#{prop['file.rcv.root']}") - private String fileRcvRoot; - @Value("#{prop['file.rcv.natl-newspaper.path']}") - private String rcvNatlNewspaperPath; private final EcNatlNewspaperService service; private final CmmFileService fileService; @@ -66,7 +62,7 @@ public class EcNatlNewspaperController extends AbstractController { @Deprecated @RequestMapping(name = "", value = "/findNatlNewspaperFiles") public ModelAndView findDirFiles(final String dirPath){ - return ResultResponse.of(FimsBizUtils.getRcvPathFiles(dirPath)); + return new ModelAndView("jsonView").addObject("result",FimsBizUtils.getRcvPathFiles(dirPath)); } @PostMapping(name = "", value = "/saveNatlNewspaers") @@ -80,12 +76,12 @@ public class EcNatlNewspaperController extends AbstractController { @GetMapping(name = "", value = "/findNatlNewspaers") public ModelAndView findNatlNewspaers(@RequestParam final Map paraMap) { - return ResultResponse.of(service.findEsbInterfaces(paraMap, MybatisUtils.getPagingInfo(paraMap))); + return new ModelAndView("jsonView").addObject("result",service.findEsbInterfaces(paraMap, MybatisUtils.getPagingInfo(paraMap))); } @RequestMapping(name = "", value = "/findNatlNewspaperAttchFiles") public ModelAndView findNatlNewspaperAttchFiles(final String interfaceSeqN) { - return ResultResponse.of( + return new ModelAndView("jsonView").addObject("result", fileService.findFilesByEsbInterfaces( CmmFileDTO.FileMst.builder() .infType(FimsConst.FileInfType.NATL_NEWS_PAPER_RCV.getCode()) diff --git a/src/main/java/cokr/xit/fims/biz/rt/web/RtCrackdownMgtController.java b/src/main/java/cokr/xit/fims/biz/rt/web/RtCrackdownMgtController.java index b9addc64..fe52ced1 100644 --- a/src/main/java/cokr/xit/fims/biz/rt/web/RtCrackdownMgtController.java +++ b/src/main/java/cokr/xit/fims/biz/rt/web/RtCrackdownMgtController.java @@ -15,7 +15,7 @@ import cokr.xit.fims.biz.rt.RtDTO; import cokr.xit.fims.biz.rt.service.RtCrackdownMgtService; import cokr.xit.fims.framework.biz.cmm.service.CmmFileService; import cokr.xit.fims.framework.core.constants.FrameworkConstants; -import cokr.xit.fims.framework.core.ResultResponse; + import cokr.xit.fims.framework.support.mybatis.MybatisUtils; import cokr.xit.fims.framework.support.util.AjaxMessageMapRenderer; import cokr.xit.fims.framework.support.util.Checks; @@ -55,17 +55,17 @@ public class RtCrackdownMgtController extends AbstractController { @GetMapping(name = "", value = "/findRtReglts") public ModelAndView findRtReglts(@RequestParam final Map paraMap) { - return ResultResponse.of(service.findRtReglts(paraMap, MybatisUtils.getPagingInfo(paraMap))); + return new ModelAndView("jsonView").addObject("result",service.findRtReglts(paraMap, MybatisUtils.getPagingInfo(paraMap))); } @GetMapping(name = "", value = "/findRtReglt") public ModelAndView findRtReglt(final RtDTO.Request dto) { - return ResultResponse.of(service.findRtReglt(dto)); + return new ModelAndView("jsonView").addObject("result",service.findRtReglt(dto)); } @GetMapping(name = "", value = "/findRtRegltByVhrno") public ModelAndView findRtRegltByVhrno(final RtDTO.Request dto) { - return ResultResponse.of(service.findRtRegltByVhrno(dto)); + return new ModelAndView("jsonView").addObject("result",service.findRtRegltByVhrno(dto)); } @RequestMapping(name = "", value = "/findRtRegltAndAttchFiles") @@ -106,6 +106,6 @@ public class RtCrackdownMgtController extends AbstractController { @RequestMapping(name = "", value = "/findRtRegltAttchFiles") public ModelAndView findRtRegltAttchFiles(final RtDTO.Request dto) { - return ResultResponse.of(service.findRtRegltAttchFiles(dto)); + return new ModelAndView("jsonView").addObject("result",service.findRtRegltAttchFiles(dto)); } } diff --git a/src/main/java/cokr/xit/fims/framework/biz/cache/service/CacheService.java b/src/main/java/cokr/xit/fims/framework/biz/cache/service/CacheService.java index c0adf0d8..1084cba3 100644 --- a/src/main/java/cokr/xit/fims/framework/biz/cache/service/CacheService.java +++ b/src/main/java/cokr/xit/fims/framework/biz/cache/service/CacheService.java @@ -57,7 +57,6 @@ public interface CacheService { - List> findLatestBbsList(); List findBaseBbsList(final Map paraMap); void evictLatestBbsList(); void evictBaseBbsList(); diff --git a/src/main/java/cokr/xit/fims/framework/biz/cache/service/bean/CacheServiceBean.java b/src/main/java/cokr/xit/fims/framework/biz/cache/service/bean/CacheServiceBean.java index c3435b56..fddffd24 100644 --- a/src/main/java/cokr/xit/fims/framework/biz/cache/service/bean/CacheServiceBean.java +++ b/src/main/java/cokr/xit/fims/framework/biz/cache/service/bean/CacheServiceBean.java @@ -21,14 +21,10 @@ import java.util.Map; @RequiredArgsConstructor @Service public class CacheServiceBean extends AbstractServiceBean implements CacheService { - @Value("#{prop['Globals.Xit.RollingNotiBbsId']}") - private String notiBbsId; - @Value("#{prop['Globals.Xit.Bbs.parntsSntncNo']}") - private String parntsSntncNo; - @Value("#{prop['Globals.Xit.Bbs.useYn']}") - private String useYn; + + private final CacheCodeMapper codeMapper; private final CacheMenuMapper menuMapper; private final CacheBbsMapper bbsMapper; @@ -108,18 +104,7 @@ public class CacheServiceBean extends AbstractServiceBean implements CacheServic // --------------------------------------------------------------------------------------------------------- // BBS // --------------------------------------------------------------------------------------------------------- - @Override - @Cacheable(cacheNames="latestBbsCache") - @Transactional(readOnly = true) - public List> findLatestBbsList() { - Map paraMap = new HashMap<>(); - paraMap.put("bbsId", this.notiBbsId); - paraMap.put("parntsSntncNo", this.parntsSntncNo); - paraMap.put("useYn", this.useYn); - paraMap.put("page", 1); - paraMap.put("perPage", 10); - return bbsMapper.selectLatestBbsList(paraMap, MybatisUtils.getPagingInfo(paraMap)); - } + @Override @Cacheable(cacheNames="baseBbsCache", key = "#paraMap") diff --git a/src/main/java/cokr/xit/fims/framework/biz/cache/util/CacheServiceUtils.java b/src/main/java/cokr/xit/fims/framework/biz/cache/util/CacheServiceUtils.java index bcc8ac60..17246a8d 100644 --- a/src/main/java/cokr/xit/fims/framework/biz/cache/util/CacheServiceUtils.java +++ b/src/main/java/cokr/xit/fims/framework/biz/cache/util/CacheServiceUtils.java @@ -67,13 +67,6 @@ public class CacheServiceUtils { - // --------------------------------------------------------------------------------------------------------- - // BBS - // --------------------------------------------------------------------------------------------------------- - public static List> findLatestBbsList() { - return JBeanRegistry.getCacheService().findLatestBbsList(); - } - public static List findBaseBbsList(final Map paraMap) { return JBeanRegistry.getCacheService().findBaseBbsList(paraMap); } diff --git a/src/main/java/cokr/xit/fims/framework/biz/cache/web/CacheController.java b/src/main/java/cokr/xit/fims/framework/biz/cache/web/CacheController.java index c3aea20e..f2f7a14b 100644 --- a/src/main/java/cokr/xit/fims/framework/biz/cache/web/CacheController.java +++ b/src/main/java/cokr/xit/fims/framework/biz/cache/web/CacheController.java @@ -1,10 +1,6 @@ package cokr.xit.fims.framework.biz.cache.web; import cokr.xit.foundation.web.AbstractController; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; import cokr.xit.fims.framework.biz.cache.util.CacheServiceUtils; import cokr.xit.fims.framework.biz.mng.bbs.XitBasicBbsMngSearchVO; import cokr.xit.fims.framework.core.constants.FrameworkConstants; @@ -20,7 +16,6 @@ import java.util.Map; * 공통코드, 사용자코드 콘트롤러 * */ -@Api(value="Cache Controller", tags = "CacheController") @Controller @RequestMapping(name = "", value="/framework/biz/cmm/cache") public class CacheController extends AbstractController { @@ -31,8 +26,7 @@ public class CacheController extends AbstractController { * @return ModelAndView */ - @ApiOperation(value = "공통 코드 목록 조회", notes = "공통 코드 목록 조회") - @ApiImplicitParam(name = "grpId", value = "공통코드 ID", required=true, paramType = "query", dataTypeClass = String.class, defaultValue = "FIM001") + @GetMapping(name = "", value="/getCodeList") public ModelAndView getCodeList( final String grpId) { @@ -46,8 +40,7 @@ public class CacheController extends AbstractController { * @param grpId String * @return ModelAndView */ - @ApiOperation(value = "공통 콤보 코드 목록 조회", notes = "공통 콤보 코드 목록 조회") - @ApiImplicitParam(name = "grpId", value = "공통코드 ID", required=true, paramType = "query", dataTypeClass = String.class, defaultValue = "FIM001") + @GetMapping(name = "", value="/getComboCodeList") public ModelAndView getComboCodeList( final String grpId) { @@ -56,11 +49,7 @@ public class CacheController extends AbstractController { return mav; } - @ApiOperation(value = "공통 콤보 코드(타입) 목록 조회", notes = "공통 콤보 코드(타입) 목록 조회") - @ApiImplicitParams ({ - @ApiImplicitParam(name = "grpId", value = "공통코드 ID", paramType = "query", dataTypeClass = String.class, defaultValue = ""), - @ApiImplicitParam(name = "type", value = "타입", required = true, paramType = "query", dataTypeClass = String.class, defaultValue = "AUTHOR_GRP") - }) + @GetMapping(name = "", value="/getComboCodeTypeList") public ModelAndView getComboCodeTypeList(final String grpId, final String type) { ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW); diff --git a/src/main/java/cokr/xit/fims/framework/biz/cmm/dao/XitExcelMapper.java b/src/main/java/cokr/xit/fims/framework/biz/cmm/dao/XitExcelMapper.java deleted file mode 100644 index a9ad9c88..00000000 --- a/src/main/java/cokr/xit/fims/framework/biz/cmm/dao/XitExcelMapper.java +++ /dev/null @@ -1,31 +0,0 @@ -package cokr.xit.fims.framework.biz.cmm.dao; - -import org.apache.ibatis.session.ResultHandler; -import org.apache.poi.ss.formula.functions.T; -import org.mybatis.spring.support.SqlSessionDaoSupport; - -/** - * - * @업무그룹명: Select 데이터 Row단위 처리 - * @설명: - * @최초작성일: 2020. 3. 24. 오후 1:42:15 - * @최초작성자: 박민규 - * @author (주)엑스아이티 개발팀 - * @since 2002. 2. 2. - * @version 1.0 Copyright(c) XIT All rights reserved. - */ -public class XitExcelMapper extends SqlSessionDaoSupport{ - - public void queryWithRowHandler(String queryId, Object obj, ResultHandler resultHandler){ -// if(queryId.indexOf("bcms") > -1){ -// ApplicationContext appContext = ContextLoaderListener.getCurrentWebApplicationContext(); -// SqlSessionFactory sfb = (SqlSessionFactory)appContext.getBean("sqlSessionBcms"); -// super.setSqlSessionFactory(sfb); -// }else{ -// ApplicationContext appContext = ContextLoaderListener.getCurrentWebApplicationContext(); -// SqlSessionFactory sfb = (SqlSessionFactory)appContext.getBean("sqlSession"); -// super.setSqlSessionFactory(sfb); -// } - getSqlSession().select(queryId, obj, resultHandler); - } -} diff --git a/src/main/java/cokr/xit/fims/framework/biz/cmm/dao/XitFrameUnitMapper.java b/src/main/java/cokr/xit/fims/framework/biz/cmm/dao/XitFrameUnitMapper.java index 7ad3c7fd..0905de2f 100644 --- a/src/main/java/cokr/xit/fims/framework/biz/cmm/dao/XitFrameUnitMapper.java +++ b/src/main/java/cokr/xit/fims/framework/biz/cmm/dao/XitFrameUnitMapper.java @@ -1,8 +1,8 @@ package cokr.xit.fims.framework.biz.cmm.dao; -import cokr.xit.fims.framework.biz.cmm.XitBbsVO; + import cokr.xit.fims.framework.biz.mng.user.XitUserInfoVO; -import cokr.xit.fims.framework.core.XitRollingNotiVO; + import org.egovframe.rte.psl.dataaccess.mapper.Mapper; import java.sql.SQLException; @@ -68,14 +68,6 @@ public interface XitFrameUnitMapper { - /** - *
메소드 설명: 게시판 최신 게시글 목록 조회
- * @param xitRollingNotiVO - * @return List 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 10. 14. - */ - public List findLatestBbsList(XitRollingNotiVO xitRollingNotiVO); public XitUserInfoVO findXitUserInfoByAccountInfo(XitUserInfoVO userUsrVO); } diff --git a/src/main/java/cokr/xit/fims/framework/biz/cmm/service/XitFrameUnitService.java b/src/main/java/cokr/xit/fims/framework/biz/cmm/service/XitFrameUnitService.java index 2141c903..58186407 100644 --- a/src/main/java/cokr/xit/fims/framework/biz/cmm/service/XitFrameUnitService.java +++ b/src/main/java/cokr/xit/fims/framework/biz/cmm/service/XitFrameUnitService.java @@ -97,7 +97,7 @@ public interface XitFrameUnitService { * :비밀번호힌트가 일치하지 않을 경우 * :비밀번호정답이 일치하지 않을 경우 * - * @param user_se + * @param jijache * @param accountId 로그인 ID * @param name * @param email @@ -154,7 +154,7 @@ public interface XitFrameUnitService { *
메소드 설명: 사용자ID 중복 확인
 	 * 	-기등록된 ID가 존재할 경우 1, 없을 경우 0을 반환 한다.
 	 * 
- * @param id + * @param acconuntId * @return int 요청처리 후 응답객체 * @author: 박민규 * @date: 2020. 4. 10. @@ -255,17 +255,7 @@ public interface XitFrameUnitService { - /** - *
메소드 설명: 게시판 최신 게시글 목록 조회
- * @param isRequired 필수여부(true: 무조건 조회, false: 조회된 목록 데이터가 없을 경우만 조회) - * @return List 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 10. 14. - */ - public List findLatestBbsList(boolean isRequired); - - - + diff --git a/src/main/java/cokr/xit/fims/framework/biz/cmm/service/bean/CmmFileServiceBean.java b/src/main/java/cokr/xit/fims/framework/biz/cmm/service/bean/CmmFileServiceBean.java index 7f07385a..bfb09a9b 100644 --- a/src/main/java/cokr/xit/fims/framework/biz/cmm/service/bean/CmmFileServiceBean.java +++ b/src/main/java/cokr/xit/fims/framework/biz/cmm/service/bean/CmmFileServiceBean.java @@ -30,17 +30,16 @@ import java.util.Objects; @RequiredArgsConstructor public class CmmFileServiceBean extends AbstractServiceBean implements CmmFileService { - @Value("#{prop['file.upload.root']}") - private String uploadRoot; - @Value("#{prop['file.upload.allow.ext']}") - private String allowExt; + private String uploadRoot = "/data/fims/upload"; + + + private String allowExt =""; /** * kbyte */ - @Value("#{prop['file.upload.allow.max-size']}") - private long maxSize; + private long maxSize = 2048; private final CmmFileMapper mapper; diff --git a/src/main/java/cokr/xit/fims/framework/biz/cmm/service/bean/XitFrameUnitServiceBean.java b/src/main/java/cokr/xit/fims/framework/biz/cmm/service/bean/XitFrameUnitServiceBean.java index bfd36cef..362f6034 100644 --- a/src/main/java/cokr/xit/fims/framework/biz/cmm/service/bean/XitFrameUnitServiceBean.java +++ b/src/main/java/cokr/xit/fims/framework/biz/cmm/service/bean/XitFrameUnitServiceBean.java @@ -10,15 +10,13 @@ import cokr.xit.fims.framework.biz.mng.auth.XitAuthorGroupInfoVO; import cokr.xit.fims.framework.biz.mng.auth.XitRoleSclsrtRescueVO; import cokr.xit.fims.framework.biz.mng.user.XitUserInfoVO; import cokr.xit.fims.framework.biz.mng.user.XitUserScrtySetupVO; -import cokr.xit.fims.framework.core.constants.FrameworkConstants.USER_SE; import cokr.xit.fims.framework.core.XitAttachFileRespVO; -import cokr.xit.fims.framework.core.XitRollingNotiVO; + import cokr.xit.fims.framework.core.utils.XitCmmnUtil; import cokr.xit.fims.framework.core.utils.attachfile.XitAttachFileVO; import lombok.extern.slf4j.Slf4j; import org.egovframe.rte.fdl.cmmn.exception.FdlException; import org.egovframe.rte.fdl.idgnr.EgovIdGnrService; -import org.egovframe.rte.fdl.security.intercept.EgovReloadableFilterInvocationSecurityMetadataSource; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Service; @@ -39,10 +37,8 @@ public class XitFrameUnitServiceBean extends AbstractServiceBean implements XitF @Autowired @Qualifier("fileIdGnrService") private EgovIdGnrService fileIdGnrService; - @Resource(name = "databaseSecurityMetadataSource") - private EgovReloadableFilterInvocationSecurityMetadataSource databaseSecurityMetadataSource; - @Resource - private XitRollingNotiVO xitRollingNotiVO; + + @Override public XitUserInfoVO findUserInfo(String uniqId) { @@ -273,9 +269,9 @@ public class XitFrameUnitServiceBean extends AbstractServiceBean implements XitF if (isExists) xitFrameCrudService.removeXitAuthorRoleRelate(vo); } - // Spring Security metadata 실시간 갱신 + try { - databaseSecurityMetadataSource.reload(); + } catch (Exception e) { e.printStackTrace(); } @@ -411,21 +407,7 @@ public class XitFrameUnitServiceBean extends AbstractServiceBean implements XitF return XitCmmnUtil.notEmpty(result); } - @Override - public List findLatestBbsList(boolean isRequired) { - List result = xitRollingNotiVO.getList(); - - if (isRequired) { - // 무조건 조회 - result = xitFrameUnitMapper.findLatestBbsList(xitRollingNotiVO); - } else { - // 목록 데이터가 없을 경우만 조회 - if (XitCmmnUtil.isEmpty(result)) - result = xitFrameUnitMapper.findLatestBbsList(xitRollingNotiVO); - } - return result; - } /** *
diff --git a/src/main/java/cokr/xit/fims/framework/biz/cmm/web/CmmAnsTmplController.java b/src/main/java/cokr/xit/fims/framework/biz/cmm/web/CmmAnsTmplController.java
index 1cda11ac..a0f58692 100644
--- a/src/main/java/cokr/xit/fims/framework/biz/cmm/web/CmmAnsTmplController.java
+++ b/src/main/java/cokr/xit/fims/framework/biz/cmm/web/CmmAnsTmplController.java
@@ -5,7 +5,7 @@ import cokr.xit.fims.framework.biz.cache.util.CacheServiceUtils;
 import cokr.xit.fims.framework.biz.cmm.CmmAnsTmplDTO;
 import cokr.xit.fims.framework.biz.cmm.service.CmmAnsTmplService;
 import cokr.xit.fims.framework.core.constants.FrameworkConstants;
-import cokr.xit.fims.framework.core.ResultResponse;
+
 import cokr.xit.fims.framework.support.mybatis.MybatisUtils;
 import cokr.xit.fims.framework.support.util.AjaxMessageMapRenderer;
 import cokr.xit.fims.framework.support.util.Checks;
@@ -68,7 +68,7 @@ public class CmmAnsTmplController extends AbstractController {
 
     @GetMapping(name = "", value = "/findCmmAnsTmpls")
     public ModelAndView findCmmAnsTmpls(@RequestParam final Map paraMap){
-        return ResultResponse.of(service.findCmmAnsTmplList(paraMap, MybatisUtils.getPagingInfo(paraMap)));
+        return new ModelAndView("jsonView").addObject("result",service.findCmmAnsTmplList(paraMap, MybatisUtils.getPagingInfo(paraMap)));
     }
     
     @PostMapping(name = "", value = "/addCmmAnsTmpls")//, consumes = "multipart/form-data"
diff --git a/src/main/java/cokr/xit/fims/framework/biz/cmm/web/CmmFileMgtController.java b/src/main/java/cokr/xit/fims/framework/biz/cmm/web/CmmFileMgtController.java
index 44e9ee45..e766111d 100644
--- a/src/main/java/cokr/xit/fims/framework/biz/cmm/web/CmmFileMgtController.java
+++ b/src/main/java/cokr/xit/fims/framework/biz/cmm/web/CmmFileMgtController.java
@@ -5,7 +5,7 @@ import cokr.xit.fims.framework.biz.cmm.CmmFileDTO;
 import cokr.xit.fims.framework.biz.cmm.service.CmmFileService;
 import cokr.xit.fims.framework.core.constants.ErrorCode;
 import cokr.xit.fims.framework.core.constants.FrameworkConstants;
-import cokr.xit.fims.framework.core.ResultResponse;
+
 import cokr.xit.fims.framework.support.exception.BizRuntimeException;
 import cokr.xit.fims.framework.support.exception.CustomBaseException;
 import cokr.xit.fims.framework.support.util.AjaxMessageMapRenderer;
@@ -39,8 +39,8 @@ import java.util.Arrays;
 @RequiredArgsConstructor
 @RequestMapping(name = "", value = "/framework/biz/cmm/file")
 public class CmmFileMgtController extends AbstractController {
-    @Value("#{prop['file.upload.root']}")
-    private String uploadRoot;
+
+    private String uploadRoot = "/data/fims/upload";
     private final CmmFileService cmmFileService;
 
     @RequestMapping(name = "", value = "/cmmImageViewPopup")
@@ -164,7 +164,7 @@ public class CmmFileMgtController extends AbstractController {
     @GetMapping(name = "", value = "/{fileMstId:[\\\\d]+}")
     public ModelAndView findFiles(@PathVariable("fileMstId") final String fileMstId) {
         if(Checks.isEmpty(fileMstId)) throw BizRuntimeException.create(MessageKey.CUSTOM_MSG, "대상 파일[fileMstId]을 선택해 주세요.");
-        return ResultResponse.of(cmmFileService.findFiles(fileMstId));
+        return new ModelAndView("jsonView").addObject("result",cmmFileService.findFiles(fileMstId));
     }
 
 
diff --git a/src/main/java/cokr/xit/fims/framework/biz/cmm/web/FrameworkCmmController.java b/src/main/java/cokr/xit/fims/framework/biz/cmm/web/FrameworkCmmController.java
index 8f6b3c9d..1b156eb4 100644
--- a/src/main/java/cokr/xit/fims/framework/biz/cmm/web/FrameworkCmmController.java
+++ b/src/main/java/cokr/xit/fims/framework/biz/cmm/web/FrameworkCmmController.java
@@ -36,10 +36,10 @@ public class FrameworkCmmController extends AbstractController {
 	@Resource(name = "xitMessageSource")
 	XitMessageSource xitMessageSource;
 
-	@Value("#{prop['Globals.Xit.Pagination.PageUnit']}")
-	private int PAGE_UNIT;
-	@Value("#{prop['Globals.Xit.Pagination.PageSize']}")
-	private int PAGE_SIZE;
+
+	private int PAGE_UNIT = 10;
+
+	private int PAGE_SIZE = 10;
 
 	/**
 	 * 
메소드 설명: 우편번호 검색 페이지
diff --git a/src/main/java/cokr/xit/fims/framework/biz/cmm/web/XitFrameAnonymousController.java b/src/main/java/cokr/xit/fims/framework/biz/cmm/web/XitFrameAnonymousController.java index 994c4f02..ec2782ea 100644 --- a/src/main/java/cokr/xit/fims/framework/biz/cmm/web/XitFrameAnonymousController.java +++ b/src/main/java/cokr/xit/fims/framework/biz/cmm/web/XitFrameAnonymousController.java @@ -55,14 +55,12 @@ public class XitFrameAnonymousController extends AbstractController { @Resource(name = "xitMessageSource") XitMessageSource xitMessageSource; - @Value("#{prop['Globals.Xit.JoinMembership.Sttus']}") - private String MEMBER_STATUS; - @Value("#{prop['Globals.Xit.JoinMembership.Sttus.Gnr']}") - private String MEMBER_STATUS_GNR; - @Value("#{prop['Globals.Xit.JoinMembership.Sttus.Ent']}") - private String MEMBER_STATUS_ENT; - @Value("#{prop['Globals.Xit.JoinMembership.Sttus.Usr']}") - private String MEMBER_STATUS_USR; + + private String MEMBER_STATUS ="A"; + + + + private String MEMBER_STATUS_USR = ""; /** @@ -299,11 +297,9 @@ public class XitFrameAnonymousController extends AbstractController { /** *
메소드 설명: (일반/기업/업무)사용자 유형별 회원가입 상태코드를 반환 한다.
-	 * 	-사용자 유형별 지정한 상태코드 설정값이 없을 경우 default값(Globals.Xit.JoinMembership.Sttus)를 반환 한다.
+
 	 * 	[사용자 유형별 회원가입 상태코드 설정]
-	 * 	 Globals.Xit.JoinMembership.Sttus.Gnr //일반회원
-	 * 	 Globals.Xit.JoinMembership.Sttus.Ent //기업회원
-	 * 	 Globals.Xit.JoinMembership.Sttus.Usr //업무사용자
+
 	 * 
* @param userSe 사용자 유형 * @return String 요청처리 후 응답객체 diff --git a/src/main/java/cokr/xit/fims/framework/biz/cmm/web/XitFramePopupController.java b/src/main/java/cokr/xit/fims/framework/biz/cmm/web/XitFramePopupController.java index a681ca7d..32d5128b 100644 --- a/src/main/java/cokr/xit/fims/framework/biz/cmm/web/XitFramePopupController.java +++ b/src/main/java/cokr/xit/fims/framework/biz/cmm/web/XitFramePopupController.java @@ -35,10 +35,10 @@ public class XitFramePopupController extends AbstractController { @Resource(name = "xitMessageSource") XitMessageSource xitMessageSource; - @Value("#{prop['Globals.Xit.Pagination.PageUnit']}") - private int PAGE_UNIT; - @Value("#{prop['Globals.Xit.Pagination.PageSize']}") - private int PAGE_SIZE; + + private int PAGE_UNIT = 10; + + private int PAGE_SIZE = 10; /** *
메소드 설명: 우편번호 검색 페이지
diff --git a/src/main/java/cokr/xit/fims/framework/biz/cmm/web/XitLoginController.java b/src/main/java/cokr/xit/fims/framework/biz/cmm/web/XitLoginController.java index 20312eb0..3c8efce4 100644 --- a/src/main/java/cokr/xit/fims/framework/biz/cmm/web/XitLoginController.java +++ b/src/main/java/cokr/xit/fims/framework/biz/cmm/web/XitLoginController.java @@ -51,18 +51,16 @@ public class XitLoginController extends AbstractController { @Autowired private XitMessageSource xitMessageSource; - @Value("#{prop['Globals.Xit.LoginPage']}") - private String LOGIN_PAGE; - @Value("#{prop['Globals.Xit.AccessDeniedPage']}") - private String ACCESS_DENIED_PAGE; - @Value("#{prop['Globals.Xit.MainPage']}") - private String MAIN_PAGE; - @Value("#{prop['Globals.Xit.MainPage.Gnr']}") - private String MAIN_PAGE_GNR; - @Value("#{prop['Globals.Xit.MainPage.Ent']}") - private String MAIN_PAGE_ENT; - @Value("#{prop['Globals.Xit.MainPage.Usr']}") - private String MAIN_PAGE_USR; + + private String LOGIN_PAGE ="framework/biz/login/XitLoginUsr"; + + private String ACCESS_DENIED_PAGE = "login/XitAccessDenied"; + + private String MAIN_PAGE = "/framework/biz/cmm/mainPage.do"; + + + + private String MAIN_PAGE_USR =""; /** * 로그인 후 메인화면으로 들어간다 diff --git a/src/main/java/cokr/xit/fims/framework/biz/mng/admin/web/XitAdminDbMngController.java b/src/main/java/cokr/xit/fims/framework/biz/mng/admin/web/XitAdminDbMngController.java index 20dbe0e1..d07ea5be 100644 --- a/src/main/java/cokr/xit/fims/framework/biz/mng/admin/web/XitAdminDbMngController.java +++ b/src/main/java/cokr/xit/fims/framework/biz/mng/admin/web/XitAdminDbMngController.java @@ -7,7 +7,7 @@ import cokr.xit.fims.framework.core.constants.FrameworkConstants; import cokr.xit.fims.framework.core.message.XitMessageSource; import cokr.xit.fims.framework.support.util.AjaxUtils; import org.egovframe.rte.ptl.mvc.tags.ui.pagination.PaginationInfo; -import org.json.simple.JSONArray; + import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.ui.ModelMap; @@ -50,246 +50,16 @@ public class XitAdminDbMngController extends AbstractController { - /** - *
메소드 설명: 관리자DB관리 목록 페이지 조회
- * @param searchVO - * @param model - * @return String 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 9. 28. - */ - @RequestMapping(name = "", value = "AdminDbMng_list.ajax", method={RequestMethod.GET, RequestMethod.POST}) - @ResponseBody - public Map AdminDbMng_listAjax(@ModelAttribute("searchVO") XitAdminDbMngSearchVO searchVO - , ModelMap model - , @RequestParam(value="jsonArr", required=false) JSONArray jsonArr - ) { - - - - - /** paging */ - PaginationInfo paginationInfo = new PaginationInfo(); - paginationInfo.setCurrentPageNo(searchVO.getPageNum()>-1?searchVO.getPageNum():searchVO.getPageIndex()); - paginationInfo.setRecordCountPerPage(searchVO.getFetchSize()>-1?searchVO.getFetchSize():searchVO.getPageUnit()); - paginationInfo.setPageSize(searchVO.getPageSize()); - searchVO.setFirstIndex(paginationInfo.getFirstRecordIndex()); - searchVO.setLastIndex(paginationInfo.getLastRecordIndex()); - searchVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage()); - - Map resultMap = new HashMap(); - try { - String dynamicSql = jsonArr.get(0).toString(); - dynamicSql = this.decrypt(dynamicSql, SALTKEY); - String cmd = this.getCmd(dynamicSql); - if(!cmd.equals("select")) - throw new RuntimeException("유효하지 않은 요청 입니다."); - - - /** - * 조회 - */ - List> list = xitAdminDbMngService.findList(dynamicSql); - int totCnt = list.size(); - paginationInfo.setTotalRecordCount(totCnt); - /** - * 반환값 설정 - */ - /* *************************** - * tui Grid Response Set - *************************** */ - resultMap.put("result", true); //[tui Grid] result - resultMap.put("message", xitMessageSource.getMessage("success.common.select")); //[tui Grid] result message - Map data = new HashMap(); - data.put("contents", list); //[tui Grid] data-contents - Map pagination = new HashMap(); - pagination.put("pageNum", searchVO.getPageNum()); - pagination.put("totalSize", totCnt); - data.put("pagination", pagination); //[tui Grid] data-paging - resultMap.put("data", data); //[tui Grid] data - /* *************************** - * //tui Grid Response Set - *************************** */ - } catch (Exception e) { - /** - * 반환값 설정 - */ - //tui Grid Response Set - resultMap.put("result", false); //[tui Grid] result - resultMap.put("message", xitMessageSource.getMessage("fail.common.select")); //[tui Grid] result message - } - - return resultMap; - } + - /** - *
메소드 설명: 사용자별권한관리 CUD 처리
- * @return String 요청처리 후 응답객체 - * @author: 박민규 - * @throws IOException - * @throws ServletException - * @date: 2020. 4. 16. - */ - @RequestMapping(name = "", value = "AdminDbMng_proc", method=RequestMethod.POST) - public String AdminDbMng_proc( -// @ModelAttribute("vo") XitAdminDbMngVO vo - @ModelAttribute("searchVO") XitAdminDbMngSearchVO searchVO - ,BindingResult bindingResult - ,SessionStatus status - , @RequestParam(value="jsonArr", required=false) JSONArray jsonArr - ,Model model - ,HttpServletRequest request - ,HttpServletResponse response - ) throws ServletException, IOException { - - /** - * 처리 분기 - */ - String sLocationUrl = "forward:/framework/biz/mng/admin/AdminDbMng_list.do"; - String message = null; - int resultCnt = 0; - String cmd = null; //질의문 명령어 구분 - String dynamicSql = ""; //질의문 - StringBuffer arrmessage = new StringBuffer(); //질의문 처리결과 메시지 - List>> arrDataset = new ArrayList>>(); - //질의문 갯수만큼 loop - for(int i=0; i 0) - arrmessage.append("\\n"); - try { - //질의문 Get - dynamicSql = jsonArr.get(i).toString(); - dynamicSql = this.decrypt(dynamicSql, SALTKEY); - //cmd Set - cmd = this.getCmd(dynamicSql); - - //cmd별 질의문 실행 - switch (cmd) { - - case "select": //조회 - //처리 - try { - List> list = xitAdminDbMngService.findList(dynamicSql); - message = xitMessageSource.getMessage("success.common.select"); - message = String.format("%s건의 데이터가 %s", list.size(), message); - arrmessage.append(message); //질의문실행결과 - arrDataset.add(list); - } catch (Exception e) { - message = xitMessageSource.getMessage("fail.common.select"); - arrmessage.append(String.format("%s :: %s", message, e.getMessage())); //질의문실행결과 - } - break; - - case "insert": //등록 - //처리 - try { - resultCnt = xitAdminDbMngService.addProc(dynamicSql); - status.setComplete(); - message = xitMessageSource.getMessage("success.common.insert"); - message = String.format("%s건의 데이터가 %s", resultCnt, message); - arrmessage.append(message); //질의문실행결과 - } catch (RuntimeException e) { - message = e.getMessage(); - sLocationUrl = "forward:/framework/biz/mng/admin/AdminDbMng_list.do"; - arrmessage.append(message); //질의문실행결과 - } catch (Exception e) { - message = xitMessageSource.getMessage("fail.common.insert"); - sLocationUrl = "forward:/framework/biz/mng/admin/AdminDbMng_list.do"; - arrmessage.append(String.format("%s :: %s", message, e.getMessage())); //질의문실행결과 - } - break; - - case "update": //수정 - //처리 - try { - resultCnt = xitAdminDbMngService.modifyProc(dynamicSql); - status.setComplete(); - message = xitMessageSource.getMessage("success.common.update"); - message = String.format("%s건의 데이터가 %s", resultCnt, message); - arrmessage.append(message); //질의문실행결과 - } catch (RuntimeException e) { - message = e.getMessage(); - sLocationUrl = "forward:/framework/biz/mng/admin/AdminDbMng_list.do"; - arrmessage.append(message); //질의문실행결과 - } catch (Exception e) { - message = xitMessageSource.getMessage("fail.common.update"); - sLocationUrl = "forward:/framework/biz/mng/admin/AdminDbMng_list.do"; - arrmessage.append(String.format("%s :: %s", message, e.getMessage())); //질의문실행결과 - } - break; - - case "delete": //삭제 - //처리 - try { - resultCnt = xitAdminDbMngService.removeProc(dynamicSql); - status.setComplete(); - message = xitMessageSource.getMessage("success.common.delete"); - message = String.format("%s건의 데이터가 %s", resultCnt, message); - arrmessage.append(message); //질의문실행결과 - } catch (RuntimeException e) { - message = e.getMessage(); - arrmessage.append(message); //질의문실행결과 - } catch (Exception e) { - message = xitMessageSource.getMessage("fail.common.delete"); - arrmessage.append(String.format("%s :: %s", message, e.getMessage())); //질의문실행결과 - } - break; - - default: - new RuntimeException("유효하지 않은 요청 입니다."); - } - } catch (RuntimeException e) { - arrmessage.append(String.format("%s번째 질의문 Getting Fail", i)); - } catch (Exception e) { - arrmessage.append(e.getMessage()); - } - } - - + - /** - * 응답 설정 - */ - /* ============================ - * 2020.09.10 박민규 - * 서버 호출 방식에 관계 없이 응답처리가 가능하도록 개선 - * -기존 호출방식도 유지하며 ajax로 서버호출 시 json 으로 응답처리가 가능하도록 개선 - * [AS-IS] 반환타입 String, return url에 "forward"구문으로 처리 - * [TO-BE] 반환타입 void, DispatchServlet으로 forward 처리, ajax 호출인 경우 json응답처리 서비스로 forward - * 2021.05.03 박민규 - * json 응답방식 변경 - * -.사유: 소스코드 간소화 - * -.작업내용 - * AsIs: 간소화 - * ToBe: - ============================ */ - //2020.09.10 주석처리 -// model.addAttribute("message", message); -// return sLocationUrl; - //2021.05.03 주석처리 -// model.addAttribute("message", message); -// if(AjaxUtils.isAjaxRequest(request)){ //ajax 요청시 -// //반환 데이터 설정 -// Map resultMap = new HashMap(); -// resultMap.put("message", message); -// resultMap.put("arrmessage", arrmessage.toString()); //질의문실행결과 -// XitCmmnUtil.forwardForAjaxRequest(request, response, resultMap, true); -// }else { //submit 요청 시 -// XitCmmnUtil.forwardForSubmitRequest(request, response, sLocationUrl, model.asMap()); -// } - model.addAttribute("message", message); - model.addAttribute("arrmessage", arrmessage.toString()); - model.addAttribute("arrDataset", arrDataset); //select문 실행결과 - if(AjaxUtils.isAjaxRequest(request)) //ajax 요청시 - return FrameworkConstants.JSON_VIEW; - else //submit 요청 시 - return sLocationUrl; - } + /** *
메소드 설명: 질의문 커맨드 반환
diff --git a/src/main/java/cokr/xit/fims/framework/biz/mng/auth/web/AuthAuthorMgtController.java b/src/main/java/cokr/xit/fims/framework/biz/mng/auth/web/AuthAuthorMgtController.java index 25370a47..0ecc229a 100644 --- a/src/main/java/cokr/xit/fims/framework/biz/mng/auth/web/AuthAuthorMgtController.java +++ b/src/main/java/cokr/xit/fims/framework/biz/mng/auth/web/AuthAuthorMgtController.java @@ -4,7 +4,7 @@ import cokr.xit.foundation.web.AbstractController; import cokr.xit.fims.framework.biz.mng.auth.XitAuthorInfoVO; import cokr.xit.fims.framework.biz.mng.auth.service.AuthAuthorMgtService; import cokr.xit.fims.framework.core.constants.FrameworkConstants; -import cokr.xit.fims.framework.core.ResultResponse; + import cokr.xit.fims.framework.support.mybatis.MybatisUtils; import cokr.xit.fims.framework.support.util.AjaxMessageMapRenderer; import cokr.xit.fims.framework.support.util.Checks; @@ -58,7 +58,7 @@ public class AuthAuthorMgtController extends AbstractController { */ @GetMapping(name = "", value = "findAuthAuthors") public ModelAndView findAuthAuthors(@RequestParam final Map paraMap) { - return ResultResponse.of(service.findAuthAuthors(paraMap, MybatisUtils.getPagingInfo(paraMap))); + return new ModelAndView("jsonView").addObject("result",service.findAuthAuthors(paraMap, MybatisUtils.getPagingInfo(paraMap))); } @PostMapping(name = "", value = "/addAuthAuthor") @@ -117,7 +117,7 @@ public class AuthAuthorMgtController extends AbstractController { @GetMapping(name = "", value="/findAuthRoleGrantList") public ModelAndView findAuthRoleGrantList(@RequestParam final Map paraMap) { - return ResultResponse.of(service.findAuthRoleGrantList(paraMap)); + return new ModelAndView("jsonView").addObject("result",service.findAuthRoleGrantList(paraMap)); } @PostMapping(name = "", value = "/saveAuthRoleGrantList") diff --git a/src/main/java/cokr/xit/fims/framework/biz/mng/auth/web/AuthByUserMgtController.java b/src/main/java/cokr/xit/fims/framework/biz/mng/auth/web/AuthByUserMgtController.java index 2da4e4ee..2237c24d 100644 --- a/src/main/java/cokr/xit/fims/framework/biz/mng/auth/web/AuthByUserMgtController.java +++ b/src/main/java/cokr/xit/fims/framework/biz/mng/auth/web/AuthByUserMgtController.java @@ -4,7 +4,7 @@ import cokr.xit.foundation.web.AbstractController; import cokr.xit.fims.framework.biz.cache.util.CacheServiceUtils; import cokr.xit.fims.framework.biz.mng.auth.service.AuthByUserMgtService; import cokr.xit.fims.framework.core.constants.FrameworkConstants; -import cokr.xit.fims.framework.core.ResultResponse; + import cokr.xit.fims.framework.support.mybatis.MybatisUtils; import cokr.xit.fims.framework.support.util.AjaxMessageMapRenderer; import cokr.xit.fims.framework.support.util.constants.MessageKey; @@ -49,7 +49,7 @@ public class AuthByUserMgtController extends AbstractController { @GetMapping(name = "", value = "/findAuthUsers") public ModelAndView findAuthUsers(@RequestParam final Map paraMap) { - return ResultResponse.of(service.findAuthUsers(paraMap, MybatisUtils.getPagingInfo(paraMap))); + return new ModelAndView("jsonView").addObject("result",service.findAuthUsers(paraMap, MybatisUtils.getPagingInfo(paraMap))); } @PostMapping(name = "", value = "/saveAuthUserList") diff --git a/src/main/java/cokr/xit/fims/framework/biz/mng/auth/web/AuthGrpMgtController.java b/src/main/java/cokr/xit/fims/framework/biz/mng/auth/web/AuthGrpMgtController.java index 64f1c377..5dfa010e 100644 --- a/src/main/java/cokr/xit/fims/framework/biz/mng/auth/web/AuthGrpMgtController.java +++ b/src/main/java/cokr/xit/fims/framework/biz/mng/auth/web/AuthGrpMgtController.java @@ -4,7 +4,7 @@ import cokr.xit.foundation.web.AbstractController; import cokr.xit.fims.framework.biz.mng.auth.XitAuthorGroupInfoVO; import cokr.xit.fims.framework.biz.mng.auth.service.AuthGrpMgtService; import cokr.xit.fims.framework.core.constants.FrameworkConstants; -import cokr.xit.fims.framework.core.ResultResponse; + import cokr.xit.fims.framework.support.mybatis.MybatisUtils; import cokr.xit.fims.framework.support.util.AjaxMessageMapRenderer; import cokr.xit.fims.framework.support.util.Checks; @@ -52,7 +52,7 @@ public class AuthGrpMgtController extends AbstractController { @GetMapping(name = "", value = "/findAuthGrps") public ModelAndView findAuthAuthors(@RequestParam final Map paraMap) { - return ResultResponse.of(service.findAuthGrps(paraMap, MybatisUtils.getPagingInfo(paraMap))); + return new ModelAndView("jsonView").addObject("result",service.findAuthGrps(paraMap, MybatisUtils.getPagingInfo(paraMap))); } @PostMapping(name = "", value = "/addAuthGrp") diff --git a/src/main/java/cokr/xit/fims/framework/biz/mng/auth/web/AuthHierarchyMgtController.java b/src/main/java/cokr/xit/fims/framework/biz/mng/auth/web/AuthHierarchyMgtController.java index d2cdd493..88639f1f 100644 --- a/src/main/java/cokr/xit/fims/framework/biz/mng/auth/web/AuthHierarchyMgtController.java +++ b/src/main/java/cokr/xit/fims/framework/biz/mng/auth/web/AuthHierarchyMgtController.java @@ -6,7 +6,7 @@ import cokr.xit.fims.framework.biz.mng.auth.XitAuthorInfoVO; import cokr.xit.fims.framework.biz.mng.auth.service.AuthAuthorMgtService; import cokr.xit.fims.framework.biz.mng.auth.service.AuthHierarchyMgtService; import cokr.xit.fims.framework.core.constants.FrameworkConstants; -import cokr.xit.fims.framework.core.ResultResponse; + import cokr.xit.fims.framework.support.exception.BizRuntimeException; import cokr.xit.fims.framework.support.mybatis.MybatisUtils; import cokr.xit.fims.framework.support.util.AjaxMessageMapRenderer; @@ -45,9 +45,7 @@ public class AuthHierarchyMgtController extends AbstractController { private final AuthHierarchyMgtService service; private final AuthAuthorMgtService authAuthorMgtService; - private final EgovSecuredObjectService egovSecuredObjectService; - private final RoleHierarchyImpl roleHierarchyImpl; - private final EgovJdbcUserDetailsManager egovJdbcUserDetailsManager; + @@ -94,7 +92,7 @@ public class AuthHierarchyMgtController extends AbstractController { @GetMapping(name = "", value = "/findAuthHierarchies") public ModelAndView findAuthHierarchies(@RequestParam final Map paraMap){ - return ResultResponse.of(service.findAuthHierarchies(paraMap, MybatisUtils.getPagingInfo(paraMap))); + return new ModelAndView("jsonView").addObject("result",service.findAuthHierarchies(paraMap, MybatisUtils.getPagingInfo(paraMap))); } @PostMapping(name = "", value = "/saveAuthHierarchy") @@ -107,25 +105,5 @@ public class AuthHierarchyMgtController extends AbstractController { return mav; } - @PostMapping(name = "", value = "/reloadAuthHierarchy") - public ModelAndView reloadAuthHierarchy(){ - ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW); - - /** - * 롤계층정보 reload - * -재접속 후 변경된 롤계층정보가 적용 됨. - */ - String hierachicaRoles = null; - try { - hierachicaRoles = egovSecuredObjectService.getHierarchicalRoles(); - } catch (Exception e) { - throw BizRuntimeException.create(MessageKey.CUSTOM_MSG, e.getMessage()); - } - roleHierarchyImpl.setHierarchy(hierachicaRoles); - RoleHierarchy roleHierarchy = roleHierarchyImpl; - egovJdbcUserDetailsManager.setRoleHierarchy(roleHierarchy); - AjaxMessageMapRenderer.success(mav, MessageKey.CMM_SUCCESS); - return mav; - } } diff --git a/src/main/java/cokr/xit/fims/framework/biz/mng/auth/web/AuthRoleMgtController.java b/src/main/java/cokr/xit/fims/framework/biz/mng/auth/web/AuthRoleMgtController.java index 6b2a8e61..05c4f41c 100644 --- a/src/main/java/cokr/xit/fims/framework/biz/mng/auth/web/AuthRoleMgtController.java +++ b/src/main/java/cokr/xit/fims/framework/biz/mng/auth/web/AuthRoleMgtController.java @@ -4,7 +4,7 @@ import cokr.xit.foundation.web.AbstractController; import cokr.xit.fims.framework.biz.mng.auth.XitRoleInfoVO; import cokr.xit.fims.framework.biz.mng.auth.service.AuthRoleMgtService; import cokr.xit.fims.framework.core.constants.FrameworkConstants; -import cokr.xit.fims.framework.core.ResultResponse; + import cokr.xit.fims.framework.support.mybatis.MybatisUtils; import cokr.xit.fims.framework.support.util.AjaxMessageMapRenderer; import cokr.xit.fims.framework.support.util.Checks; @@ -59,7 +59,7 @@ public class AuthRoleMgtController extends AbstractController { */ @GetMapping(name = "", value = "/findAuthRoles") public ModelAndView findAuthRoles(@RequestParam final Map paraMap) { - return ResultResponse.of(service.findAuthRoles(paraMap, MybatisUtils.getPagingInfo(paraMap))); + return new ModelAndView("jsonView").addObject("result",service.findAuthRoles(paraMap, MybatisUtils.getPagingInfo(paraMap))); } @PostMapping(name = "", value = "/addAuthRole") diff --git a/src/main/java/cokr/xit/fims/framework/biz/mng/batch/XitBatchRegMngSearchVO.java b/src/main/java/cokr/xit/fims/framework/biz/mng/batch/XitBatchRegMngSearchVO.java deleted file mode 100644 index af2e9daf..00000000 --- a/src/main/java/cokr/xit/fims/framework/biz/mng/batch/XitBatchRegMngSearchVO.java +++ /dev/null @@ -1,23 +0,0 @@ -package cokr.xit.fims.framework.biz.mng.batch; - -import cokr.xit.fims.framework.core.XitBaseSearchVO; - -/** - * - * @업무그룹명: 배치작업관리 SearchVO - * @설명: - * @최초작성일: 2020. 7. 13. 오후 4:49:51 - * @최초작성자: 박민규 - * @author (주)엑스아이티 개발팀 - * @since 2002. 2. 2. - * @version 1.0 Copyright(c) XIT All rights reserved. - */ -public class XitBatchRegMngSearchVO extends XitBaseSearchVO{ - - /** - * serialVersionUID - */ - private static final long serialVersionUID = 1L; - - -} diff --git a/src/main/java/cokr/xit/fims/framework/biz/mng/batch/XitBatchRegMngVO.java b/src/main/java/cokr/xit/fims/framework/biz/mng/batch/XitBatchRegMngVO.java deleted file mode 100644 index a21cffb1..00000000 --- a/src/main/java/cokr/xit/fims/framework/biz/mng/batch/XitBatchRegMngVO.java +++ /dev/null @@ -1,219 +0,0 @@ -package cokr.xit.fims.framework.biz.mng.batch; - -import cokr.xit.fims.framework.core.BaseVO; - -/** - * - * @업무그룹명: 배치작업관리 VO - * @설명: - * @최초작성일: 2020. 7. 13. 오후 4:50:55 - * @최초작성자: 박민규 - * @author (주)엑스아이티 개발팀 - * @since 2002. 2. 2. - * @version 1.0 Copyright(c) XIT All rights reserved. - */ -public class XitBatchRegMngVO extends BaseVO { - - /** - * serialVersionUID - */ - private static final long serialVersionUID = 1L; - - - /** - * 배치작업ID - */ - private String batchOpertId; - /** - * 배치작업명 - */ - private String batchOpertNm; - /** - * 배치작업구분 //2021.10.07 박민규 - 추가 - */ - private String batchOpertSe; - /** - * 배치프로그램 - */ - private String batchProgrm; - /** - * 최종수정자 아이디 - */ - private String mdfr; - /** - * 최종수정일 - */ - private String mdfcnDt; - /** - * 파라미터 - */ - private String paramtr; - /** - * 사용여부 - */ - private String useYn; - /** - * 최초등록자 아이디 - */ - private String rgtr; - /** - * 최초등록시점 - */ - private String regDt; - - /** - * 배치작업ID를 리턴한다. - * @return the batchOpertId - */ - public String getBatchOpertId() { - return batchOpertId; - } - - /** - * 배치작업ID를 설정한다. - * @param batchOpertId 설정할 배치작업ID - */ - public void setBatchOpertId(String batchOpertId) { - this.batchOpertId = batchOpertId; - } - - /** - * 배치작업명을 리턴한다. - * @return the batchOpertNm - */ - public String getBatchOpertNm() { - return batchOpertNm; - } - - /** - * 배치작업명을 설정한다. - * @param batchOpertNm 설정할 배치작업명 - */ - public void setBatchOpertNm(String batchOpertNm) { - this.batchOpertNm = batchOpertNm; - } - - /** - * 배치작업구분을 리턴한다. - * @return the batchOpertSe - */ - public String getBatchOpertSe() { - return batchOpertSe; - } - - /** - * 배치작업구분을 설정한다. - * @param batchOpertSe 설정할 배치작업구분 - */ - public void setBatchOpertSe(String batchOpertSe) { - this.batchOpertSe = batchOpertSe; - } - - /** - * 배치프로그램을 리턴한다. - * @return the batchProgrm - */ - public String getBatchProgrm() { - return batchProgrm; - } - - /** - * 배치프로그램을 설정한다. - * @param batchProgrm 설정할 배치프로그램 - */ - public void setBatchProgrm(String batchProgrm) { - this.batchProgrm = batchProgrm; - } - - /** - * 최종수정자ID를 리턴한다. - * @return the mdfr - */ - public String getMdfr() { - return mdfr; - } - - /** - * 최종수정자ID를 설정한다. - * @param mdfr 설정할 최종수정자ID - */ - public void setMdfr(String mdfr) { - this.mdfr = mdfr; - } - - /** - * 최종수정시점을 리턴한다. - * @return the mdfcnDt - */ - public String getMdfcnDt() { - return mdfcnDt; - } - - /** - * 최종수정시점을 설정한다. - * @param mdfcnDt 설정할 최종수정시점 - */ - public void setMdfcnDt(String mdfcnDt) { - this.mdfcnDt = mdfcnDt; - } - - /** - * 파라미터를 리턴한다. - * @return the paramtr - */ - public String getParamtr() { - return paramtr; - } - - /** - * 파라미터를 설정한다. - * @param paramtr 설정할 파라미터 - */ - public void setParamtr(String paramtr) { - this.paramtr = paramtr; - } - - /** - * 사용여부를 리턴한다. - * @return the useYn - */ - public String getUseYn() { - return useYn; - } - - /** - * 사용여부를 설정한다. - * @param useYn 설정할 사용여부 - */ - public void setUseYn(String useYn) { - this.useYn = useYn; - } - - /** - * @return the rgtr - */ - public String getRgtr() { - return rgtr; - } - - /** - * @return the regDt - */ - public String getRegDt() { - return regDt; - } - - /** - * @param rgtr the rgtr to set - */ - public void setRgtr(String rgtr) { - this.rgtr = rgtr; - } - - /** - * @param regDt the regDt to set - */ - public void setRegDt(String regDt) { - this.regDt = regDt; - } -} diff --git a/src/main/java/cokr/xit/fims/framework/biz/mng/batch/XitBatchResultMngSearchVO.java b/src/main/java/cokr/xit/fims/framework/biz/mng/batch/XitBatchResultMngSearchVO.java deleted file mode 100644 index 0557759f..00000000 --- a/src/main/java/cokr/xit/fims/framework/biz/mng/batch/XitBatchResultMngSearchVO.java +++ /dev/null @@ -1,38 +0,0 @@ -package cokr.xit.fims.framework.biz.mng.batch; - -import cokr.xit.fims.framework.core.XitBaseSearchVO; - -/** - * - * @업무그룹명: 배치결과관리 SearchVO - * @설명: - * @최초작성일: 2020. 7. 13. 오후 4:52:09 - * @최초작성자: 박민규 - * @author (주)엑스아이티 개발팀 - * @since 2002. 2. 2. - * @version 1.0 Copyright(c) XIT All rights reserved. - */ -public class XitBatchResultMngSearchVO extends XitBaseSearchVO{ - - /** - * serialVersionUID - */ - private static final long serialVersionUID = 1L; - - - - /** - * 상태 - */ - private String sttus; - - - - public String getSttus() { - return sttus; - } - public void setSttus(String sttus) { - this.sttus = sttus; - } - -} diff --git a/src/main/java/cokr/xit/fims/framework/biz/mng/batch/XitBatchResultMngVO.java b/src/main/java/cokr/xit/fims/framework/biz/mng/batch/XitBatchResultMngVO.java deleted file mode 100644 index eb3af546..00000000 --- a/src/main/java/cokr/xit/fims/framework/biz/mng/batch/XitBatchResultMngVO.java +++ /dev/null @@ -1,294 +0,0 @@ -package cokr.xit.fims.framework.biz.mng.batch; - -import cokr.xit.fims.framework.core.BaseVO; - -/** - * - * @업무그룹명: 배치결과관리 VO - * @설명: - * @최초작성일: 2020. 7. 13. 오후 4:51:36 - * @최초작성자: 박민규 - * @author (주)엑스아이티 개발팀 - * @since 2002. 2. 2. - * @version 1.0 Copyright(c) XIT All rights reserved. - */ -public class XitBatchResultMngVO extends BaseVO { - - /** - * serialVersionUID - */ - private static final long serialVersionUID = 1L; - /** - * 배치결과ID - */ - private String batchResultId; - /** - * 배치스케줄ID - */ - private String batchSchdulId; - - /** - * 배치작업ID - */ - private String batchOpertId; - /** - * 파라미터 - */ - private String paramtr; - /** - * 상태 - */ - private String sttus; - /** - * 실행시작시각 - */ - private String executBeginTime; - /** - * 실행종료시각 - */ - private String executEndTime; - /** - * 최종수정자 아이디 - */ - private String mdfr; - /** - * 최종수정시점 - */ - private String mdfcnDt; - /** - * 최초등록자 아이디 - */ - private String rgtr; - /** - * 최초등록시점 - */ - private String regDt; - /** - * 에러정보 - */ - private String errorInfo; - - /** - * 배치작업명 - */ - private String batchOpertNm; - /** - * 배치프로그램 - */ - private String batchProgrm; - /** - * 상태명 - */ - private String sttusNm; - - /** - * @return the batchResultId - */ - public String getBatchResultId() { - return batchResultId; - } - - /** - * @return the batchOpertId - */ - public String getBatchOpertId() { - return batchOpertId; - } - - /** - * @return the paramtr - */ - public String getParamtr() { - return paramtr; - } - - /** - * @return the sttus - */ - public String getSttus() { - return sttus; - } - - /** - * @return the executBeginTime - */ - public String getExecutBeginTime() { - return executBeginTime; - } - - /** - * @return the executEndTime - */ - public String getExecutEndTime() { - return executEndTime; - } - - /** - * @return the mdfr - */ - public String getMdfr() { - return mdfr; - } - - /** - * @return the mdfcnDt - */ - public String getMdfcnDt() { - return mdfcnDt; - } - - /** - * @return the rgtr - */ - public String getRgtr() { - return rgtr; - } - - /** - * @return the regDt - */ - public String getRegDt() { - return regDt; - } - - /** - * @return the errorInfo - */ - public String getErrorInfo() { - return errorInfo; - } - - /** - * @return the batchOpertNm - */ - public String getBatchOpertNm() { - return batchOpertNm; - } - - /** - * @return the batchProgrm - */ - public String getBatchProgrm() { - return batchProgrm; - } - - /** - * @return the sttusNm - */ - public String getSttusNm() { - return sttusNm; - } - - /** - * @param batchResultId the batchResultId to set - */ - public void setBatchResultId(String batchResultId) { - this.batchResultId = batchResultId; - } - - /** - * @param batchOpertId the batchOpertId to set - */ - public void setBatchOpertId(String batchOpertId) { - this.batchOpertId = batchOpertId; - } - - /** - * @param paramtr the paramtr to set - */ - public void setParamtr(String paramtr) { - this.paramtr = paramtr; - } - - /** - * @param sttus the sttus to set - */ - public void setSttus(String sttus) { - this.sttus = sttus; - } - - /** - * @param executBeginTime the executBeginTime to set - */ - public void setExecutBeginTime(String executBeginTime) { - this.executBeginTime = executBeginTime; - } - - /** - * @param executEndTime the executEndTime to set - */ - public void setExecutEndTime(String executEndTime) { - this.executEndTime = executEndTime; - } - - /** - * @param mdfr the mdfr to set - */ - public void setMdfr(String mdfr) { - this.mdfr = mdfr; - } - - /** - * @param mdfcnDt the mdfcnDt to set - */ - public void setMdfcnDt(String mdfcnDt) { - this.mdfcnDt = mdfcnDt; - } - - /** - * @param rgtr the rgtr to set - */ - public void setRgtr(String rgtr) { - this.rgtr = rgtr; - } - - /** - * @param regDt the regDt to set - */ - public void setRegDt(String regDt) { - this.regDt = regDt; - } - - /** - * @param errorInfo the errorInfo to set - */ - public void setErrorInfo(String errorInfo) { - this.errorInfo = errorInfo; - } - - /** - * @param batchOpertNm the batchOpertNm to set - */ - public void setBatchOpertNm(String batchOpertNm) { - this.batchOpertNm = batchOpertNm; - } - - /** - * @param batchProgrm the batchProgrm to set - */ - public void setBatchProgrm(String batchProgrm) { - this.batchProgrm = batchProgrm; - } - - /** - * @param sttusNm the sttusNm to set - */ - public void setSttusNm(String sttusNm) { - this.sttusNm = sttusNm; - } - - /** - * @return the batchSchdulId - */ - public String getBatchSchdulId() { - return batchSchdulId; - } - - /** - * @param batchSchdulId the batchSchdulId to set - */ - public void setBatchSchdulId(String batchSchdulId) { - this.batchSchdulId = batchSchdulId; - } - -} diff --git a/src/main/java/cokr/xit/fims/framework/biz/mng/batch/XitBatchScheduleDayOfWeekVO.java b/src/main/java/cokr/xit/fims/framework/biz/mng/batch/XitBatchScheduleDayOfWeekVO.java deleted file mode 100644 index 881148e3..00000000 --- a/src/main/java/cokr/xit/fims/framework/biz/mng/batch/XitBatchScheduleDayOfWeekVO.java +++ /dev/null @@ -1,77 +0,0 @@ -package cokr.xit.fims.framework.biz.mng.batch; - -import cokr.xit.fims.framework.core.BaseVO; - -/** - * - * @업무그룹명: 배치작업스케줄요일 VO - * @설명: - * @최초작성일: 2020. 7. 14. 오후 4:08:55 - * @최초작성자: 박민규 - * @author (주)엑스아이티 개발팀 - * @since 2002. 2. 2. - * @version 1.0 Copyright(c) XIT All rights reserved. - */ -public class XitBatchScheduleDayOfWeekVO extends BaseVO { - - - /** - * serialVersionUID - */ - private static final long serialVersionUID = 393393635146750800L; - - /** - * 배치스케줄ID - */ - private String batchSchdulId; - - /** - * 실행스케줄요일 - */ - private String executSchdulDfkSe; - - /** - * 실행스케줄요일명 - */ - private String executSchdulDfkSeNm; - - - /** - * @return the batchSchdulId - */ - public String getBatchSchdulId() { - return batchSchdulId; - } - /** - * @return the executSchdulDfkSe - */ - public String getExecutSchdulDfkSe() { - return executSchdulDfkSe; - } - /** - * @param batchSchdulId the batchSchdulId to set - */ - public void setBatchSchdulId(String batchSchdulId) { - this.batchSchdulId = batchSchdulId; - } - /** - * @param executSchdulDfkSe the executSchdulDfkSe to set - */ - public void setExecutSchdulDfkSe(String executSchdulDfkSe) { - this.executSchdulDfkSe = executSchdulDfkSe; - } - /** - * @return the executSchdulDfkSeNm - */ - public String getExecutSchdulDfkSeNm() { - return executSchdulDfkSeNm; - } - /** - * @param executSchdulDfkSeNm the executSchdulDfkSeNm to set - */ - public void setExecutSchdulDfkSeNm(String executSchdulDfkSeNm) { - this.executSchdulDfkSeNm = executSchdulDfkSeNm; - } - - -} diff --git a/src/main/java/cokr/xit/fims/framework/biz/mng/batch/XitBatchScheduleMngSearchVO.java b/src/main/java/cokr/xit/fims/framework/biz/mng/batch/XitBatchScheduleMngSearchVO.java deleted file mode 100644 index 3d9887c5..00000000 --- a/src/main/java/cokr/xit/fims/framework/biz/mng/batch/XitBatchScheduleMngSearchVO.java +++ /dev/null @@ -1,22 +0,0 @@ -package cokr.xit.fims.framework.biz.mng.batch; - -import cokr.xit.fims.framework.core.XitBaseSearchVO; - -/** - * - * @업무그룹명: 배치스케줄관리 SearchVO - * @설명: - * @최초작성일: 2020. 7. 13. 오후 4:52:45 - * @최초작성자: 박민규 - * @author (주)엑스아이티 개발팀 - * @since 2002. 2. 2. - * @version 1.0 Copyright(c) XIT All rights reserved. - */ -public class XitBatchScheduleMngSearchVO extends XitBaseSearchVO{ - - /** - * serialVersionUID - */ - private static final long serialVersionUID = 1L; - -} diff --git a/src/main/java/cokr/xit/fims/framework/biz/mng/batch/XitBatchScheduleMngVO.java b/src/main/java/cokr/xit/fims/framework/biz/mng/batch/XitBatchScheduleMngVO.java deleted file mode 100644 index 2ec852fe..00000000 --- a/src/main/java/cokr/xit/fims/framework/biz/mng/batch/XitBatchScheduleMngVO.java +++ /dev/null @@ -1,468 +0,0 @@ -package cokr.xit.fims.framework.biz.mng.batch; - -import cokr.xit.fims.framework.core.BaseVO; - -import java.util.List; - -/** - * - * @업무그룹명: 배치스케줄관리 VO - * @설명: - * @최초작성일: 2020. 7. 13. 오후 4:53:11 - * @최초작성자: 박민규 - * @author (주)엑스아이티 개발팀 - * @since 2002. 2. 2. - * @version 1.0 Copyright(c) XIT All rights reserved. - */ -public class XitBatchScheduleMngVO extends BaseVO { - - /** - * serialVersionUID - */ - private static final long serialVersionUID = 1L; - - - - - /** - * 배치스케줄ID - */ - private String batchSchdulId; - - /** - * 배치작업ID - */ - private String batchOpertId; - - /** - * 실행주기 - */ - private String executCycle; - /** - * 실행스케줄일자 - */ - private String executSchdulDe; - /** - * 실행스케줄시 - */ - private String executSchdulHour; - /** - * 실행스케줄분 - */ - private String executSchdulMnt; - /** - * 실행스케줄초 - */ - private String executSchdulSecnd; - /** - * 실행스케줄요일 - */ - private String[] executSchdulDfkSes; - - /** - * 최종수정자 아이디 - */ - private String mdfr; - /** - * 최종수정시점 - */ - private String mdfcnDt; - /** - * 최초등록자 아이디 - */ - private String rgtr; - /** - * 최초등록시점 - */ - private String regDt; - - /** - * 배치작업명 - */ - private String batchOpertNm; - /** - * 배치프로그램 - */ - private String batchProgrm; - /** - * 파라미터 - */ - private String paramtr; - /** - * 실행주기명 - */ - private String executCycleNm; - /** - * 실행스케줄 - */ - private String executSchdul; - - /** - * @return the batchSchdulId - */ - public String getBatchSchdulId() { - return batchSchdulId; - } - - /** - * @return the batchOpertId - */ - public String getBatchOpertId() { - return batchOpertId; - } - - /** - * @return the executCycle - */ - public String getExecutCycle() { - return executCycle; - } - - /** - * @return the executSchdulDe - */ - public String getExecutSchdulDe() { - return executSchdulDe; - } - - /** - * @return the executSchdulHour - */ - public String getExecutSchdulHour() { - return executSchdulHour; - } - - /** - * @return the executSchdulMnt - */ - public String getExecutSchdulMnt() { - return executSchdulMnt; - } - - /** - * @return the executSchdulSecnd - */ - public String getExecutSchdulSecnd() { - return executSchdulSecnd; - } - - /** - * @return the executSchdulDfkSes - */ - public String[] getExecutSchdulDfkSes() { - //return executSchdulDfkSes; - String[] ret = null; - if (this.executSchdulDfkSes != null) { - ret = new String[executSchdulDfkSes.length]; - for (int i = 0; i < executSchdulDfkSes.length; i++) { - ret[i] = this.executSchdulDfkSes[i]; - } - } - - return ret; - } - - /** - * @return the mdfr - */ - public String getMdfr() { - return mdfr; - } - - /** - * @return the mdfcnDt - */ - public String getMdfcnDt() { - return mdfcnDt; - } - - /** - * @return the rgtr - */ - public String getRgtr() { - return rgtr; - } - - /** - * @return the regDt - */ - public String getRegDt() { - return regDt; - } - - /** - * @return the batchOpertNm - */ - public String getBatchOpertNm() { - return batchOpertNm; - } - - /** - * @return the batchProgrm - */ - public String getBatchProgrm() { - return batchProgrm; - } - - /** - * @return the executCycleNm - */ - public String getExecutCycleNm() { - return executCycleNm; - } - - /** - * @param batchSchdulId the batchSchdulId to set - */ - public void setBatchSchdulId(String batchSchdulId) { - this.batchSchdulId = batchSchdulId; - } - - /** - * @param batchOpertId the batchOpertId to set - */ - public void setBatchOpertId(String batchOpertId) { - this.batchOpertId = batchOpertId; - } - - /** - * @param executCycle the executCycle to set - */ - public void setExecutCycle(String executCycle) { - this.executCycle = executCycle; - } - - /** - * @param executSchdulDe the executSchdulDe to set - */ - public void setExecutSchdulDe(String executSchdulDe) { - this.executSchdulDe = executSchdulDe; - } - - /** - * @param executSchdulHour the executSchdulHour to set - */ - public void setExecutSchdulHour(String executSchdulHour) { - this.executSchdulHour = executSchdulHour; - } - - /** - * @param executSchdulMnt the executSchdulMnt to set - */ - public void setExecutSchdulMnt(String executSchdulMnt) { - this.executSchdulMnt = executSchdulMnt; - } - - /** - * @param executSchdulSecnd the executSchdulSecnd to set - */ - public void setExecutSchdulSecnd(String executSchdulSecnd) { - this.executSchdulSecnd = executSchdulSecnd; - } - - /** - * @param executSchdulDfkSes the executSchdulDfkSes to set - */ - public void setExecutSchdulDfkSes(String[] executSchdulDfkSes) { - //this.executSchdulDfkSes = executSchdulDfkSes; - this.executSchdulDfkSes = new String[executSchdulDfkSes.length]; - for (int i = 0; i < executSchdulDfkSes.length; ++i) { - this.executSchdulDfkSes[i] = executSchdulDfkSes[i]; - } - } - - /** - * @param mdfr the mdfr to set - */ - public void setMdfr(String mdfr) { - this.mdfr = mdfr; - } - - /** - * @param mdfcnDt the mdfcnDt to set - */ - public void setMdfcnDt(String mdfcnDt) { - this.mdfcnDt = mdfcnDt; - } - - /** - * @param rgtr the rgtr to set - */ - public void setRgtr(String rgtr) { - this.rgtr = rgtr; - } - - /** - * @param regDt the regDt to set - */ - public void setRegDt(String regDt) { - this.regDt = regDt; - } - - /** - * @param batchOpertNm the batchOpertNm to set - */ - public void setBatchOpertNm(String batchOpertNm) { - this.batchOpertNm = batchOpertNm; - } - - /** - * @param batchProgrm the batchProgrm to set - */ - public void setBatchProgrm(String batchProgrm) { - this.batchProgrm = batchProgrm; - } - - /** - * @param executCycleNm the executCycleNm to set - */ - public void setExecutCycleNm(String executCycleNm) { - this.executCycleNm = executCycleNm; - } - - /** - * @return the executSchdul - */ - public String getExecutSchdul() { - return executSchdul; - } - - /** - * @param executSchdul the executSchdul to set - */ - public void setExecutSchdul(String executSchdul) { - this.executSchdul = executSchdul; - } - - /** - * 리스트, 상세화면 화면표시용 실행스케줄속성을 만들어 executSchdul 필드에 저장한다. - * - * @param dfkSeList List형의 요일구분코드정보리스트 - */ - public void makeExecutSchdul(List dfkSeList) { - String executSchdul = ""; - String executSchdulDeNm = ""; - - // 날짜 출력 - if (this.executCycle.equals("02") || this.executCycle.equals("01")) { - // 매주, 매일인 경우는 스케줄일자를 사용하지 않는다. - executSchdulDeNm = ""; - } else if (this.executCycle.equals("03")) { - // 매월 처리 - if (!"".equals(this.executSchdulDe)) { - executSchdulDeNm = executSchdulDeNm + this.executSchdulDe.substring(6, 8) + "일 "; - } - } else if (this.executCycle.equals("04")) { - // 매년의경우 처리 - if (!"".equals(this.executSchdulDe)) { - executSchdulDeNm = executSchdulDeNm + this.executSchdulDe.substring(4, 6) + "-" + this.executSchdulDe.substring(6, 8) + " "; - } - } else { - // 이외의경우 처리 - if (!"".equals(this.executSchdulDe)) { - executSchdulDeNm = executSchdulDeNm + this.executSchdulDe.substring(0, 4) + "-" + this.executSchdulDe.substring(4, 6) + "-" + this.executSchdulDe.substring(6, 8) - + " "; - } - } - - // 날짜 출력 - executSchdul = executSchdul + executSchdulDeNm; - - // 요일출력 - if (this.executCycle.equals("02")) { - // 실행주기가 매주인 경우에만 출력한다. - if (dfkSeList.size() != 0) { - for (int i = 0; i < dfkSeList.size(); i++) { - if (i != 0) { - executSchdul = executSchdul + ","; - } - executSchdul = executSchdul + dfkSeList.get(i).getExecutSchdulDfkSeNm(); - } - executSchdul = executSchdul + " "; - } - } - - // 시, 분, 초 출력 - // 시분초는 항상출력한다. - executSchdul = executSchdul + this.executSchdulHour + ":" + this.executSchdulMnt + ":" + this.executSchdulSecnd; - - // 값지정. - this.executSchdul = executSchdul; - - } - - /** - * 실행스케줄을 CronExpression으로 바꿔서 리턴한다. - **/ - public String toCronExpression() { - String cronExpression = ""; - - // 초변환 - cronExpression = cronExpression + this.executSchdulSecnd; - - // 분변환 - cronExpression = cronExpression + " " + this.executSchdulMnt; - - // 시변환 - cronExpression = cronExpression + " " + this.executSchdulHour; - - // 일변환 - if (this.executCycle.equals("01")) { - // 매일인경우 "*" 출력 - cronExpression = cronExpression + " " + "*"; - } else if (this.executCycle.equals("02")) { - // 매주인 경우 "?" 출력 - cronExpression = cronExpression + " " + "?"; - } else { - // 이외의 경우 그대로 출력 - cronExpression = cronExpression + " " + this.executSchdulDe.substring(6, 8); - } - - // 월변환 - if (this.executCycle.equals("01") || this.executCycle.equals("02") || this.executCycle.equals("03")) { - // 매일,매월,매주인경우 "*" 출력 - cronExpression = cronExpression + " " + "*"; - } else { - // 이외의 경우 그대로 출력 - cronExpression = cronExpression + " " + this.executSchdulDe.substring(4, 6); - } - - // 주 변환 - if (this.executCycle.equals("02")) { - // 매주인경우 day of week를 출력 - String dayOfWeek = ""; - for (int i = 0; i < this.executSchdulDfkSes.length; i++) { - if (i != 0) { - dayOfWeek = dayOfWeek + ","; - } - dayOfWeek = dayOfWeek + this.executSchdulDfkSes[i]; - } - cronExpression = cronExpression + " " + dayOfWeek; - } else { - // 이외의 경우 "?" 출력 - cronExpression = cronExpression + " " + "?"; - } - - // 년변환 - if (this.executCycle.equals("05")) { - // 한번만인경우 년도 출력 - cronExpression = cronExpression + " " + this.executSchdulDe.substring(0, 4); - } - return cronExpression; - - } - - /** - * @return the paramtr - */ - public String getParamtr() { - return paramtr; - } - - /** - * @param paramtr the paramtr to set - */ - public void setParamtr(String paramtr) { - this.paramtr = paramtr; - } -} diff --git a/src/main/java/cokr/xit/fims/framework/biz/mng/batch/dao/XitBatchRegMngMapper.java b/src/main/java/cokr/xit/fims/framework/biz/mng/batch/dao/XitBatchRegMngMapper.java deleted file mode 100644 index b87cf65f..00000000 --- a/src/main/java/cokr/xit/fims/framework/biz/mng/batch/dao/XitBatchRegMngMapper.java +++ /dev/null @@ -1,51 +0,0 @@ -package cokr.xit.fims.framework.biz.mng.batch.dao; - -import cokr.xit.fims.framework.biz.mng.batch.XitBatchRegMngSearchVO; -import cokr.xit.fims.framework.biz.mng.batch.XitBatchRegMngVO; -import org.egovframe.rte.psl.dataaccess.mapper.Mapper; - -import java.sql.SQLException; -import java.util.List; - -/** - * - * @업무그룹명: 배치작업관리 Mapper - * @설명: - * @최초작성일: 2020. 7. 13. 오후 5:03:39 - * @최초작성자: 박민규 - * @author (주)엑스아이티 개발팀 - * @since 2002. 2. 2. - * @version 1.0 Copyright(c) XIT All rights reserved. - */ -@Mapper -public interface XitBatchRegMngMapper { - - - /** - *
메소드 설명: 배치작업관리 목록 조회
- * @param searchVO - * @return List 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 4. 16. - */ - public List findList(XitBatchRegMngSearchVO searchVO) throws SQLException; - - /** - *
메소드 설명: 배치작업관리 목록 총건수 조회
- * @param searchVO - * @return int 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 4. 16. - */ - public int findListTotCnt(XitBatchRegMngSearchVO searchVO) throws SQLException; - - /** - *
메소드 설명: 배치작업관리 상세정보 조회
- * @param vo - * @return XitBatchRegMngVO 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 4. 16. - */ - public XitBatchRegMngVO findView(XitBatchRegMngVO vo) throws SQLException; - -} diff --git a/src/main/java/cokr/xit/fims/framework/biz/mng/batch/dao/XitBatchResultMngMapper.java b/src/main/java/cokr/xit/fims/framework/biz/mng/batch/dao/XitBatchResultMngMapper.java deleted file mode 100644 index a25e693b..00000000 --- a/src/main/java/cokr/xit/fims/framework/biz/mng/batch/dao/XitBatchResultMngMapper.java +++ /dev/null @@ -1,51 +0,0 @@ -package cokr.xit.fims.framework.biz.mng.batch.dao; - -import cokr.xit.fims.framework.biz.mng.batch.XitBatchResultMngSearchVO; -import cokr.xit.fims.framework.biz.mng.batch.XitBatchResultMngVO; -import org.egovframe.rte.psl.dataaccess.mapper.Mapper; - -import java.sql.SQLException; -import java.util.List; - -/** - * - * @업무그룹명: 배치결과관리 Mapper - * @설명: - * @최초작성일: 2020. 7. 13. 오후 5:04:40 - * @최초작성자: 박민규 - * @author (주)엑스아이티 개발팀 - * @since 2002. 2. 2. - * @version 1.0 Copyright(c) XIT All rights reserved. - */ -@Mapper -public interface XitBatchResultMngMapper { - - - /** - *
메소드 설명: 배치결과관리 목록 조회
- * @param searchVO - * @return List 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 4. 16. - */ - public List findList(XitBatchResultMngSearchVO searchVO) throws SQLException; - - /** - *
메소드 설명: 배치결과관리 목록 총건수 조회
- * @param searchVO - * @return int 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 4. 16. - */ - public int findListTotCnt(XitBatchResultMngSearchVO searchVO) throws SQLException; - - /** - *
메소드 설명: 배치결과관리 상세정보 조회
- * @param vo - * @return XitBatchResultMngVO 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 4. 16. - */ - public XitBatchResultMngVO findView(XitBatchResultMngVO vo) throws SQLException; - -} diff --git a/src/main/java/cokr/xit/fims/framework/biz/mng/batch/dao/XitBatchScheduleMngMapper.java b/src/main/java/cokr/xit/fims/framework/biz/mng/batch/dao/XitBatchScheduleMngMapper.java deleted file mode 100644 index ca29a44b..00000000 --- a/src/main/java/cokr/xit/fims/framework/biz/mng/batch/dao/XitBatchScheduleMngMapper.java +++ /dev/null @@ -1,61 +0,0 @@ -package cokr.xit.fims.framework.biz.mng.batch.dao; - -import cokr.xit.fims.framework.biz.mng.batch.XitBatchScheduleDayOfWeekVO; -import cokr.xit.fims.framework.biz.mng.batch.XitBatchScheduleMngSearchVO; -import cokr.xit.fims.framework.biz.mng.batch.XitBatchScheduleMngVO; -import org.egovframe.rte.psl.dataaccess.mapper.Mapper; - -import java.sql.SQLException; -import java.util.List; - -/** - * - * @업무그룹명: 배치스케줄관리 Mapper - * @설명: - * @최초작성일: 2020. 7. 13. 오후 5:05:26 - * @최초작성자: 박민규 - * @author (주)엑스아이티 개발팀 - * @since 2002. 2. 2. - * @version 1.0 Copyright(c) XIT All rights reserved. - */ -@Mapper -public interface XitBatchScheduleMngMapper { - - - /** - *
메소드 설명: 배치스케줄관리 목록 조회
- * @param searchVO - * @return List 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 4. 16. - */ - public List findList(XitBatchScheduleMngSearchVO searchVO) throws SQLException; - - /** - *
메소드 설명: 배치스케줄관리 목록 총건수 조회
- * @param searchVO - * @return int 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 4. 16. - */ - public int findListTotCnt(XitBatchScheduleMngSearchVO searchVO) throws SQLException; - - /** - *
메소드 설명: 배치스케줄관리 상세정보 조회
- * @param vo - * @return XitBatchScheduleMngVO 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 4. 16. - */ - public XitBatchScheduleMngVO findView(XitBatchScheduleMngVO vo) throws SQLException; - - /** - *
메소드 설명: 배치스케줄 요일 목록 조회
- * @param vo - * @return List<XitBatchScheduleDayOfWeekVO> - * @author: 박민규 - * @date: 2020. 4. 16. - */ - public List findsBatchSchedule(XitBatchScheduleMngVO vo); - -} diff --git a/src/main/java/cokr/xit/fims/framework/biz/mng/batch/service/BatchJobListener.java b/src/main/java/cokr/xit/fims/framework/biz/mng/batch/service/BatchJobListener.java deleted file mode 100644 index e396e94a..00000000 --- a/src/main/java/cokr/xit/fims/framework/biz/mng/batch/service/BatchJobListener.java +++ /dev/null @@ -1,228 +0,0 @@ -package cokr.xit.fims.framework.biz.mng.batch.service; - -import cokr.xit.fims.framework.biz.mng.batch.XitBatchResultMngVO; -import org.egovframe.rte.fdl.cmmn.exception.FdlException; -import org.egovframe.rte.fdl.idgnr.EgovIdGnrService; -import org.quartz.JobDataMap; -import org.quartz.JobExecutionContext; -import org.quartz.JobExecutionException; -import org.quartz.JobListener; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.Locale; - -/** - * 배치작업의 실행시작, 완료를 저장하는 Quartz JobListener 클래스를 정의한다. - * - * @author 김진만 - * @see - *
- * == 개정이력(Modification Information) ==
- *
- *   수정일       수정자           수정내용
- *  -------     --------    ---------------------------
- *  2010-08-30   김진만     최초 생성
- *  2017-02-06   이정은     시큐어코딩(ES) - 시큐어코딩  부적절한 예외 처리[CWE-253, CWE-440, CWE-756]
- * 
- */ - -public class BatchJobListener implements JobListener { - - /** egovBatchSchdulService */ - private XitBatchScheduleMngService xitBatchScheduleMngService; - - /** ID Generation */ - private EgovIdGnrService idgenService; - - /** logger */ - private static final Logger LOGGER = LoggerFactory.getLogger(BatchJobListener.class); - - /** - * 배치스케줄 서비스를 설정한다. - * - * @param egovBatchSchdulService the egovBatchSchdulService to set - */ - public void setXitBatchScheduleMngService(XitBatchScheduleMngService egovBatchSchdulService) { - this.xitBatchScheduleMngService = egovBatchSchdulService; - } - - /** - * 배치결과ID 생성서비스 - * @param idgenService the idgenService to set - */ - public void setIdgenService(EgovIdGnrService idgenService) { - this.idgenService = idgenService; - } - - /** - * Job Listener 이름을 리턴한다. - * @see JobListener#getName() - */ - @Override - public String getName() { - return this.getClass().getName(); - } - - /** - * Batch 작업을 실행하기전에 Batch결과 '수행중'상태로 저장한다. - * - * @param jobContext JobExecutionContext - * @see JobListener#jobToBeExecuted(JobExecutionContext jobContext) - */ - @Override - public void jobToBeExecuted(JobExecutionContext jobContext) { - LOGGER.debug("job[{}] jobToBeExecuted ", jobContext.getJobDetail().getKey().getName()); - XitBatchResultMngVO batchResult = new XitBatchResultMngVO(); - JobDataMap dataMap = jobContext.getJobDetail().getJobDataMap(); - try { - // 결과 값 세팅. - batchResult.setBatchResultId(idgenService.getNextStringId()); - batchResult.setBatchSchdulId(dataMap.getString("batchSchdulId")); - batchResult.setBatchOpertId(dataMap.getString("batchOpertId")); - batchResult.setParamtr(dataMap.getString("paramtr")); - batchResult.setSttus("03"); // 상태는 수행중 - batchResult.setErrorInfo(""); - - String executBeginTimeStr = null; - Date executBeginTime = new Date(); - SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss", Locale.getDefault()); - executBeginTimeStr = formatter.format(executBeginTime); - batchResult.setExecutBeginTime(executBeginTimeStr); - - batchResult.setMdfr("SYSTEM"); - batchResult.setRgtr("SYSTEM"); - - xitBatchScheduleMngService.addBatchResult(batchResult); - - // 저장이 이상없이 완료되면 datamap에 배치결과ID를 저장한다. - dataMap.put("batchResultId", batchResult.getBatchResultId()); - //2017.02.06 이정은 시큐어코딩(ES)-부적절한 예외 처리[CWE-253, CWE-440, CWE-754] - } catch (FdlException e) { - LOGGER.error("[FdlException] 배치스케줄ID : {}, 배치작업ID : {}, 배치결과저장(insert) 에러 : {}", batchResult.getBatchSchdulId(), batchResult.getBatchOpertId(), e.getMessage()); - } catch (Exception e) { - LOGGER.error("(Ko) 배치스케줄ID : {}, 배치작업ID : {}, 배치결과저장(insert) 에러 : {}", batchResult.getBatchSchdulId(), batchResult.getBatchOpertId(), e.getMessage()); - LOGGER.error("(En) [" + e.getClass() + "] BatchScheduleID : {}, BatchJobID : {}, BatchResult(insert) Error : {}", batchResult.getBatchSchdulId(), batchResult.getBatchOpertId(), e.getMessage()); - } - - } - - /** - * Batch 작업을 완료한후 Batch결과 '완료'상태로 저장한다. - * - * @param jobContext JobExecutionContext - * @see JobListener#jobWasExecuted(JobExecutionContext jobContext) - */ - @Override - public void jobWasExecuted(JobExecutionContext jobContext, JobExecutionException jee) { - LOGGER.debug("job[{}] jobWasExecuted", jobContext.getJobDetail().getKey().getName()); - LOGGER.debug("job[{}] 수행시간 : {}, {}", jobContext.getJobDetail().getKey().getName(), jobContext.getFireTime(), jobContext.getJobRunTime()); - - int jobResult = 99; - XitBatchResultMngVO batchResult = new XitBatchResultMngVO(); - JobDataMap dataMap = jobContext.getJobDetail().getJobDataMap(); - try { - // 결과 값 세팅. - batchResult.setBatchResultId(dataMap.getString("batchResultId")); - batchResult.setBatchSchdulId(dataMap.getString("batchSchdulId")); - batchResult.setBatchOpertId(dataMap.getString("batchOpertId")); - batchResult.setParamtr(dataMap.getString("paramtr")); - if (jobContext.getResult() != null) { - jobResult = (Integer) jobContext.getResult(); - } - if (jobResult == 0) { - // 배치작업 성공. - batchResult.setSttus("01"); - batchResult.setErrorInfo(""); - } else { - // 배치작업이 0이 아닌값을 리턴하면 에러 상황임. - batchResult.setSttus("02"); - batchResult.setErrorInfo("배치작업이 결과값 [" + jobResult + "]를 리턴했습니다. \n" + "배치프로그램 [" + dataMap.getString("batchProgrm") + "]의 로그를 확인하세요"); - } - // 수행중 exception이 발생한 경우 - if (jee != null) { - LOGGER.error("JobExecutionException 발생 : {}", jee); - batchResult.setSttus("02"); - String errorInfo = batchResult.getErrorInfo(); - batchResult.setErrorInfo(errorInfo + "\n" + "JobExecutionException 발생 : " + jee); - } - - String executEndTimeStr = null; - Date executEndTime = new Date(); - SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss", Locale.getDefault()); - executEndTimeStr = formatter.format(executEndTime); - batchResult.setExecutEndTime(executEndTimeStr); - - batchResult.setMdfr("SYSTEM"); - - xitBatchScheduleMngService.modifyBatchResult(batchResult); - - // 저장이 이상없이 완료되면 datamap에 배치결과ID를 저장한다. - dataMap.put("batchResultId", batchResult.getBatchResultId()); - } catch (ClassCastException e) {//KISA 보안약점 조치 (2018-10-29, 윤창원) - LOGGER.error("[ClassCastException] 배치결과ID : {}, 배치스케줄ID : {}, 배치작업ID : {}, 배치결과저장(update) 에러 : {}", batchResult.getBatchResultId(), batchResult.getBatchSchdulId(), - batchResult.getBatchOpertId(), e.getMessage()); - LOGGER.error("[ClassCastException] ["+ e.getClass() + "] BatchResultID : {}, BatchScheduleID : {}, BatchJobID : {}, BatchResult(update) Error : {}", batchResult.getBatchResultId(), batchResult.getBatchSchdulId(), - batchResult.getBatchOpertId(), e.getMessage()); - } catch (Exception e) { - //2017.02.06 이정은 시큐어코딩(ES)-부적절한 예외 처리[CWE-253, CWE-440, CWE-754] - LOGGER.error("(Ko) 배치결과ID : {}, 배치스케줄ID : {}, 배치작업ID : {}, 배치결과저장(update) 에러 : {}", batchResult.getBatchResultId(), batchResult.getBatchSchdulId(), - batchResult.getBatchOpertId(), e.getMessage()); - LOGGER.error("(En) ["+ e.getClass() + "] BatchResultID : {}, BatchScheduleID : {}, BatchJobID : {}, BatchResult(update) Error : {}", batchResult.getBatchResultId(), batchResult.getBatchSchdulId(), - batchResult.getBatchOpertId(), e.getMessage()); - } - } - - /** - * Batch 작업을 실행한 후에 Batch결과 '에러'상태로 저장한다. - * - * @param jobContext JobExecutionContext - * - * @see JobListener#jobExecutionVetoed(JobExecutionContext jobContext) - */ - @Override - public void jobExecutionVetoed(JobExecutionContext jobContext) { - LOGGER.debug("job[{}] jobExecutionVetoed", jobContext.getJobDetail().getKey().getName()); - - XitBatchResultMngVO batchResult = new XitBatchResultMngVO(); - JobDataMap dataMap = jobContext.getJobDetail().getJobDataMap(); - try { - // 결과 값 세팅. - batchResult.setBatchResultId(dataMap.getString("batchResultId")); - batchResult.setBatchSchdulId(dataMap.getString("batchSchdulId")); - batchResult.setBatchOpertId(dataMap.getString("batchOpertId")); - batchResult.setParamtr(dataMap.getString("paramtr")); - // 스케줄러가 배치작업을 실행하지 않음. - batchResult.setSttus("02"); - batchResult.setErrorInfo("스케줄러가 배치작업을 실행하지 않았습니다(jobExecutionVetoed 이벤트). 스케줄러 로그를 확인하세요"); - - String executEndTimeStr = null; - Date executEndTime = new Date(); - SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss", Locale.getDefault()); - executEndTimeStr = formatter.format(executEndTime); - batchResult.setExecutEndTime(executEndTimeStr); - - batchResult.setMdfr("SYSTEM"); - - xitBatchScheduleMngService.modifyBatchResult(batchResult); - - // 저장이 이상없이 완료되면 datamap에 배치결과ID를 저장한다. - dataMap.put("batchResultId", batchResult.getBatchResultId()); - } catch (ClassCastException e) {//KISA 보안약점 조치 (2018-10-29, 윤창원) - LOGGER.error("[ClassCastException] 배치결과ID : {}, 배치스케줄ID : {}, 배치작업ID : {}, 배치결과저장(update) 에러 : {}", batchResult.getBatchResultId(), batchResult.getBatchSchdulId(), - batchResult.getBatchOpertId(), e.getMessage()); - LOGGER.error("[ClassCastException] ["+ e.getClass() + "] BatchResultID : {}, BatchScheduleID : {}, BatchJobID : {}, BatchResult(update) Error : {}", batchResult.getBatchResultId(), batchResult.getBatchSchdulId(), - batchResult.getBatchOpertId(), e.getMessage()); - } catch (Exception e) { - //2017.02.06 이정은 시큐어코딩(ES)-부적절한 예외 처리[CWE-253, CWE-440, CWE-754] - LOGGER.error("(Ko) 배치결과ID : {}, 배치스케줄ID : {}, 배치작업ID : {}, 배치결과저장(update) 에러 : {}", batchResult.getBatchResultId(), batchResult.getBatchSchdulId(), - batchResult.getBatchOpertId(), e.getMessage()); - LOGGER.error("(En) ["+ e.getClass() +"] BachResultID : {}, BatchScheduleID : {}, 배치작업ID : {}, 배치결과저장(update) 에러 : {}", batchResult.getBatchResultId(), batchResult.getBatchSchdulId(), - batchResult.getBatchOpertId(), e.getMessage()); - } - - } - -} diff --git a/src/main/java/cokr/xit/fims/framework/biz/mng/batch/service/BatchMethodExecuteJob.java b/src/main/java/cokr/xit/fims/framework/biz/mng/batch/service/BatchMethodExecuteJob.java deleted file mode 100644 index 38c7159b..00000000 --- a/src/main/java/cokr/xit/fims/framework/biz/mng/batch/service/BatchMethodExecuteJob.java +++ /dev/null @@ -1,110 +0,0 @@ -package cokr.xit.fims.framework.biz.mng.batch.service; - -import org.quartz.Job; -import org.quartz.JobDataMap; -import org.quartz.JobExecutionContext; -import org.quartz.JobExecutionException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; - -/** - * 배치서비스메소드를 실행하는 Quartz Job 클래스를 정의한다. - * - * @author 박민규 - * @see - *
- * == 개정이력(Modification Information) ==
- *
- *   수정일       수정자           수정내용
- *  -------     --------    ---------------------------
- *  2021.10.07   박민규     최초 생성
- * 
- */ - -public class BatchMethodExecuteJob implements Job { - - /** logger */ - private static final Logger LOGGER = LoggerFactory.getLogger(BatchMethodExecuteJob.class); - - /** - * (non-Javadoc) - * @see Job#execute(JobExecutionContext) - */ - public void execute(JobExecutionContext jobContext) throws JobExecutionException { - - JobDataMap dataMap = jobContext.getJobDetail().getJobDataMap(); - - LOGGER.debug("job[{}] Trigger이름 : ", jobContext.getJobDetail().getKey().getName(), jobContext.getTrigger().getKey().getName()); - LOGGER.debug("job[{}] BatchOpert이름 : ", jobContext.getJobDetail().getKey().getName(), dataMap.getString("batchOpertId")); - LOGGER.debug("job[{}] BatchProgram이름 : ", jobContext.getJobDetail().getKey().getName(), dataMap.getString("batchProgrm")); - LOGGER.debug("job[{}] Parameter이름 : ", jobContext.getJobDetail().getKey().getName(), dataMap.getString("paramtr")); - - int result = executeProgram(dataMap.getString("batchProgrm"), dataMap.getString("paramtr")); - - // jobContext에 결과값을 저장한다. - jobContext.setResult(result); - } - - /** - * 시스템에서 특정 배치서비스메소드를 실행한다. - * @param batchProgrm 배치서비스메소드 경로(ex. [패키지].[클래스].[메소드] ) - * @param paramtr 배치실행화일에 전달될 파라미터 - * @return 배치실행화일리턴값(integer) - * @exception Exception - */ - @SuppressWarnings({ "unchecked", "rawtypes" }) - private int executeProgram(String batchProgrm, String paramtr) { - - int result = 0; - - String clzName = null; - String mthName = null; - try { - String cmdStr = batchProgrm + " " + paramtr; - - int lastIdx = batchProgrm.lastIndexOf("."); - clzName = batchProgrm.substring(0, lastIdx); - mthName = batchProgrm.substring(lastIdx+1); - - Class cls = Class.forName(clzName); - Object obj = cls.newInstance(); - Method method = null; - if(paramtr == null || "".equals(paramtr)) { - method = cls.getDeclaredMethod(mthName, null); - method.invoke(obj); - } else { - method = cls.getDeclaredMethod(mthName, String.class); - method.invoke(obj, paramtr); - } - - LOGGER.debug("배치서비스메소드 - {} 실행완료, 결과값: {}", cmdStr, result); - - } catch (ClassNotFoundException e) { - result = 1; - LOGGER.error("배치서비스클래스 notfound 에러 : {}", e.getMessage()); - LOGGER.debug(e.getMessage(), e); - } catch (InstantiationException | IllegalAccessException e) { - result = 1; - LOGGER.error("배치서비스클래스 인스턴스 에러 : {}", e.getMessage()); - LOGGER.debug(e.getMessage(), e); - } catch (NoSuchMethodException e) { - result = 1; - LOGGER.error("배치서비스메소드 notfound 에러 : {}", e.getMessage()); - LOGGER.debug(e.getMessage(), e); - } catch (IllegalArgumentException e) { - result = 1; - LOGGER.error("배치서비스메소드 실행 에러 : {}", e.getMessage()); - LOGGER.debug(e.getMessage(), e); - } catch (InvocationTargetException e) { - result = 1; - LOGGER.error("배치서비스메소드 실행 에러 : {}", e.getMessage()); - LOGGER.debug(e.getMessage(), e); - } - - return result; - } - -} diff --git a/src/main/java/cokr/xit/fims/framework/biz/mng/batch/service/BatchScheduler.java b/src/main/java/cokr/xit/fims/framework/biz/mng/batch/service/BatchScheduler.java deleted file mode 100644 index 5d06c4d1..00000000 --- a/src/main/java/cokr/xit/fims/framework/biz/mng/batch/service/BatchScheduler.java +++ /dev/null @@ -1,269 +0,0 @@ -package cokr.xit.fims.framework.biz.mng.batch.service; - -import cokr.xit.fims.framework.biz.mng.batch.XitBatchRegMngVO; -import cokr.xit.fims.framework.biz.mng.batch.XitBatchScheduleMngSearchVO; -import cokr.xit.fims.framework.biz.mng.batch.XitBatchScheduleMngVO; -import cokr.xit.fims.framework.biz.mng.batch.validator.BatchOpertSe; -import org.egovframe.rte.fdl.idgnr.EgovIdGnrService; -import org.quartz.*; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.List; - -import static org.quartz.CronScheduleBuilder.cronSchedule; -import static org.quartz.JobBuilder.newJob; -import static org.quartz.TriggerBuilder.newTrigger; - -/** - * Quartz Scheduler를 실행하는 스케줄러 클래스를 정의한다. - * - * @author 김진만 - * @see - *
- * == 개정이력(Modification Information) ==
- *
- *   수정일       수정자           수정내용
- *  -------     --------    ---------------------------
- *  2010.08.30   김진만     최초 생성
- * 
- */ - -public class BatchScheduler { - - private XitBatchScheduleMngService xitBatchScheduleMngService; - private XitBatchRegMngService xitBatchRegMngService; - - /** ID Generation */ - private EgovIdGnrService idgenService; - - /** Quartz 스케줄러 */ - private Scheduler sched; - - private static final Logger LOGGER = LoggerFactory.getLogger(BatchScheduler.class); - - // 실행 대상을 읽기위한 페이지 크기 - private static final int RECORD_COUNT_PER_PAGE = 10000; - - /** - * 배치스케줄러에 batchSchdul 파라미터를 이용하여 Job , Trigger를 Add 한다. - * - * @param batchSchdul 배치스케줄러에 등록할 스케줄정보 - * @exception Exception Exception - */ - @SuppressWarnings("unchecked") - public void insertBatchSchdul(XitBatchScheduleMngVO batchSchdul) throws Exception { - // Job 만들기 -// JobDetail jobDetail = newJob(BatchShellScriptJob.class).withIdentity(batchSchdul.getBatchSchdulId()).build(); - JobDetail jobDetail = newJob(getJobClass(batchSchdul.getBatchOpertId())).withIdentity(batchSchdul.getBatchSchdulId()).build(); - - // Trigger 만들기 - CronTrigger trigger = newTrigger().withIdentity(batchSchdul.getBatchSchdulId()).withSchedule(cronSchedule(batchSchdul.toCronExpression())).forJob(jobDetail.getKey().getName()).build(); - - LOGGER.debug("배치스케줄을 등록합니다. 배치스케줄ID : {}", batchSchdul.getBatchSchdulId()); - LOGGER.debug("{} - cronexpression : {}", batchSchdul.getBatchSchdulId(), trigger.getCronExpression()); - BatchJobListener listener = new BatchJobListener(); - - listener.setXitBatchScheduleMngService(xitBatchScheduleMngService); - listener.setIdgenService(idgenService); - - sched.getListenerManager().addJobListener(listener); - - // 데이터 전달 - jobDetail.getJobDataMap().put("batchOpertId", batchSchdul.getBatchOpertId()); - jobDetail.getJobDataMap().put("batchSchdulId", batchSchdul.getBatchSchdulId()); - jobDetail.getJobDataMap().put("batchProgrm", batchSchdul.getBatchProgrm()); - jobDetail.getJobDataMap().put("paramtr", batchSchdul.getParamtr()); - - try { - // 스케줄러에 추가하기 - sched.scheduleJob(jobDetail, trigger); - } catch (SchedulerException e) { - // SchedulerException 이 발생하면 로그를 출력하고 다음 배치작업으로 넘어간다. - // 트리거의 실행시각이 현재 시각보다 이전이면 SchedulerException이 발생한다. - LOGGER.error("스케줄러에 배치작업추가할때 에러가 발생했습니다. 배치스케줄ID : {}, 배치작업ID : {}", batchSchdul.getBatchSchdulId(), batchSchdul.getBatchOpertId()); - LOGGER.error("에러내용 : {}", e.getMessage()); - LOGGER.debug(e.getMessage(), e); - } - } - - /** - * 배치스케줄러에 batchSchdul 파라미터를 이용하여 Job , Trigger를 갱신 한다. - * - * @param batchSchdul 배치스케줄러에 갱신할 스케줄정보 - * @exception Exception Exception - */ - @SuppressWarnings("unchecked") - public void updateBatchSchdul(XitBatchScheduleMngVO batchSchdul) throws Exception { - // Job 만들기 -// JobDetail jobDetail = newJob(BatchShellScriptJob.class) - JobDetail jobDetail = newJob(getJobClass(batchSchdul.getBatchOpertId())) - .withIdentity(batchSchdul.getBatchSchdulId()) - .build(); - // Trigger 만들기 - CronTrigger trigger = newTrigger() - .withIdentity(batchSchdul.getBatchSchdulId()) - .withSchedule(cronSchedule(batchSchdul.toCronExpression())) - .forJob(jobDetail.getKey().getName()) - .build(); - - LOGGER.debug("배치스케줄을 갱신합니다. 배치스케줄ID : {}", batchSchdul.getBatchSchdulId()); - LOGGER.debug("{} - cronexpression : {}", batchSchdul.getBatchSchdulId(), trigger.getCronExpression()); - - BatchJobListener listener = new BatchJobListener(); - - listener.setXitBatchScheduleMngService(xitBatchScheduleMngService); - listener.setIdgenService(idgenService); - - sched.getListenerManager().addJobListener(listener); - - // 데이터 전달 - jobDetail.getJobDataMap().put("batchOpertId", batchSchdul.getBatchOpertId()); - jobDetail.getJobDataMap().put("batchSchdulId", batchSchdul.getBatchSchdulId()); - jobDetail.getJobDataMap().put("batchProgrm", batchSchdul.getBatchProgrm()); - jobDetail.getJobDataMap().put("paramtr", batchSchdul.getParamtr()); - - try { - // 스케줄러에서 기존Job, Trigger 삭제하기 - sched.deleteJob(JobKey.jobKey(batchSchdul.getBatchSchdulId())); - // 스케줄러에 추가하기 - sched.scheduleJob(jobDetail, trigger); - } catch (SchedulerException e) { - // SchedulerException 이 발생하면 로그를 출력하고 다음 배치작업으로 넘어간다. - // 트리거의 실행시각이 현재 시각보다 이전이면 SchedulerException이 발생한다. - LOGGER.error("스케줄러에 배치작업갱신할때 에러가 발생했습니다. 배치스케줄ID : {}, 배치작업ID : {}", batchSchdul.getBatchSchdulId(), batchSchdul.getBatchOpertId()); - LOGGER.error("에러내용 : {}", e.getMessage()); - LOGGER.debug(e.getMessage(), e); - } - } - - /** - * 배치스케줄러에 batchSchdul 파라미터를 이용하여 Job , Trigger를 삭제한다. - * - * @param batchSchdul 배치스케줄러에 삭제할 스케줄정보 - * @exception Exception Exception - */ - public void deleteBatchSchdul(XitBatchScheduleMngVO batchSchdul) throws Exception { - - try { - // 스케줄러에서 기존Job, Trigger 삭제하기 - LOGGER.debug("배치스케줄을 삭제합니다. 배치스케줄ID : {}", batchSchdul.getBatchSchdulId()); - sched.deleteJob(JobKey.jobKey(batchSchdul.getBatchSchdulId())); - } catch (SchedulerException e) { - // SchedulerException 이 발생하면 로그를 출력하고 다음 배치작업으로 넘어간다. - // 트리거의 실행시각이 현재 시각보다 이전이면 SchedulerException이 발생한다. - LOGGER.error("스케줄러에 배치작업을 삭제할때 에러가 발생했습니다. 배치스케줄ID : {}, 배치작업ID : ", batchSchdul.getBatchSchdulId(), batchSchdul.getBatchOpertId()); - LOGGER.error("에러내용 : {}", e.getMessage()); - LOGGER.debug(e.getMessage(), e); - } - } - - /** - * 클래스 초기화메소드. - * 배치스케줄테이블을 읽어서 Quartz 스케줄러를 초기화한다. - * - */ - @SuppressWarnings("unchecked") - public void init() throws Exception { - // 모니터링 대상 정보 읽어들이기~~~ - List targetList = null; - XitBatchScheduleMngSearchVO searchVO = new XitBatchScheduleMngSearchVO(); - // 모니터링 대상 검색 조건 초기화 - searchVO.setPageIndex(1); - searchVO.setFirstIndex(0); - searchVO.setRecordCountPerPage(RECORD_COUNT_PER_PAGE); - targetList = (List) xitBatchScheduleMngService.findList(searchVO); - LOGGER.debug("조회조건 {}", searchVO); - LOGGER.debug("Result 건수 : {}", targetList.size()); - - // 스케줄러 생성하기 - SchedulerFactory schedFact = new org.quartz.impl.StdSchedulerFactory(); - sched = schedFact.getScheduler(); - - // Set up the listener - BatchJobListener listener = new BatchJobListener(); - - listener.setXitBatchScheduleMngService(xitBatchScheduleMngService); - listener.setIdgenService(idgenService); - - //sched.addGlobalJobListener(listener); - sched.getListenerManager().addJobListener(listener); - - // 스케줄러에 Job, Trigger 등록하기 - XitBatchScheduleMngVO target = null; - for (int i = 0; i < targetList.size(); i++) { - target = targetList.get(i); - LOGGER.debug("Data : {}", target); - - insertBatchSchdul(target); - } - - sched.start(); - } - - /** - * 클래스 destroy메소드. - * Quartz 스케줄러를 shutdown한다. - * - */ - public void destroy() throws Exception { - sched.shutdown(); - } - - /** - * 배치스케줄 서비스 리턴 - * @return the egovBatchSchdulService - */ - public XitBatchScheduleMngService getXitBatchScheduleMngService() { - return xitBatchScheduleMngService; - } - - /** - * 배치스케줄 서비스 저장. - * @param egovBatchSchdulService the egovBatchSchdulService to set - */ - public void setXitBatchScheduleMngService(XitBatchScheduleMngService egovBatchSchdulService) { - this.xitBatchScheduleMngService = egovBatchSchdulService; - } - - public XitBatchRegMngService getXitBatchRegMngService() { - return xitBatchRegMngService; - } - - public void setXitBatchRegMngService(XitBatchRegMngService xitBatchRegMngService) { - this.xitBatchRegMngService = xitBatchRegMngService; - } - - /** - * 배치결과ID 생성서비스 리턴 - * @return the idgenService - */ - public EgovIdGnrService getIdgenService() { - return idgenService; - } - - /** - * 배치결과ID 생성서비스 저장. - * @param idgenService the idgenService to set - */ - public void setIdgenService(EgovIdGnrService idgenService) { - this.idgenService = idgenService; - } - - @SuppressWarnings("rawtypes") - private Class getJobClass(String batchOpertId) { - XitBatchRegMngVO vo = new XitBatchRegMngVO(); - vo.setBatchOpertId(batchOpertId); - vo = xitBatchRegMngService.findView(vo); - - switch (BatchOpertSe.valueOf(vo.getBatchOpertSe())) { - case prm: - return BatchMethodExecuteJob.class; - case mtd: - return BatchMethodExecuteJob.class; - default: - throw new RuntimeException(String.format("유효하지 않은 코드구분(%s) 입니다.", vo.getBatchOpertSe())); - } - - } -} diff --git a/src/main/java/cokr/xit/fims/framework/biz/mng/batch/service/BatchShellScriptJob.java b/src/main/java/cokr/xit/fims/framework/biz/mng/batch/service/BatchShellScriptJob.java deleted file mode 100644 index 8afdaa78..00000000 --- a/src/main/java/cokr/xit/fims/framework/biz/mng/batch/service/BatchShellScriptJob.java +++ /dev/null @@ -1,79 +0,0 @@ -package cokr.xit.fims.framework.biz.mng.batch.service; - -import org.quartz.Job; -import org.quartz.JobDataMap; -import org.quartz.JobExecutionContext; -import org.quartz.JobExecutionException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.IOException; - -/** - * 배치쉘스크립트를 실행하는 Quartz Job 클래스를 정의한다. - * - * @author 김진만 - * @see - *
- * == 개정이력(Modification Information) ==
- *
- *   수정일       수정자           수정내용
- *  -------     --------    ---------------------------
- *  2010.08.30   김진만     최초 생성
- * 
- */ - -public class BatchShellScriptJob implements Job { - - /** logger */ - private static final Logger LOGGER = LoggerFactory.getLogger(BatchShellScriptJob.class); - - /** - * (non-Javadoc) - * @see Job#execute(JobExecutionContext) - */ - public void execute(JobExecutionContext jobContext) throws JobExecutionException { - - JobDataMap dataMap = jobContext.getJobDetail().getJobDataMap(); - - LOGGER.debug("job[{}] Trigger이름 : ", jobContext.getJobDetail().getKey().getName(), jobContext.getTrigger().getKey().getName()); - LOGGER.debug("job[{}] BatchOpert이름 : ", jobContext.getJobDetail().getKey().getName(), dataMap.getString("batchOpertId")); - LOGGER.debug("job[{}] BatchProgram이름 : ", jobContext.getJobDetail().getKey().getName(), dataMap.getString("batchProgrm")); - LOGGER.debug("job[{}] Parameter이름 : ", jobContext.getJobDetail().getKey().getName(), dataMap.getString("paramtr")); - - int result = executeProgram(dataMap.getString("batchProgrm"), dataMap.getString("paramtr")); - - // jobContext에 결과값을 저장한다. - jobContext.setResult(result); - } - - /** - * 시스템에서 특정 쉘프로그램을 실행한다. - * @param batchProgrm 배치실행화일 - * @param paramtr 배치실행화일에 전달될 파라미터 - * @return 배치실행화일리턴값(integer) - * @exception Exception - */ - private int executeProgram(String batchProgrm, String paramtr) { - - int result = 0; - try { - Process p = null; - String cmdStr = batchProgrm + " " + paramtr; - p = Runtime.getRuntime().exec(cmdStr); - p.waitFor(); - result = p.exitValue(); - LOGGER.debug("배치실행화일 - {} 실행완료, 결과값: {}", cmdStr, result); - - } catch (IOException e) { - LOGGER.error("배치스크립트 실행 에러 : {}", e.getMessage()); - LOGGER.debug(e.getMessage(), e); - } catch (InterruptedException e) { - LOGGER.error("배치스크립트 실행 에러 : {}", e.getMessage()); - LOGGER.debug(e.getMessage(), e); - } - - return result; - } - -} diff --git a/src/main/java/cokr/xit/fims/framework/biz/mng/batch/service/XitBatchRegMngService.java b/src/main/java/cokr/xit/fims/framework/biz/mng/batch/service/XitBatchRegMngService.java deleted file mode 100644 index a1cc6e6f..00000000 --- a/src/main/java/cokr/xit/fims/framework/biz/mng/batch/service/XitBatchRegMngService.java +++ /dev/null @@ -1,81 +0,0 @@ -package cokr.xit.fims.framework.biz.mng.batch.service; - -import cokr.xit.fims.framework.biz.mng.batch.XitBatchRegMngSearchVO; -import cokr.xit.fims.framework.biz.mng.batch.XitBatchRegMngVO; - -import java.util.List; - -/** - * - * @업무그룹명: 배치작업관리 Service - * @설명: - * @최초작성일: 2020. 7. 13. 오후 5:03:22 - * @최초작성자: 박민규 - * @author (주)엑스아이티 개발팀 - * @since 2002. 2. 2. - * @version 1.0 Copyright(c) XIT All rights reserved. - */ -public interface XitBatchRegMngService { - - - /** - *
메소드 설명: 배치작업관리 목록 조회
- * @param searchVO - * @return List 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 7. 13. - */ - public List findList(XitBatchRegMngSearchVO searchVO); - - /** - *
메소드 설명: 배치작업관리 목록 총건수 조회
- * @param searchVO - * @return int 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 7. 13. - */ - public int findListTotCnt(XitBatchRegMngSearchVO searchVO); - - /** - *
메소드 설명: 배치작업관리 상세정보 조회
- * @param vo - * @return XitBatchRegMngVO 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 7. 13. - */ - public XitBatchRegMngVO findView(XitBatchRegMngVO vo); - - /** - *
메소드 설명: 배치작업관리 등록
- * @param vo void 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 7. 13. - */ - public void addProc(XitBatchRegMngVO vo); - - /** - *
메소드 설명: 배치작업관리 수정
- * @param vo void 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 7. 13. - */ - public void modifyProc(XitBatchRegMngVO vo); - - /** - *
메소드 설명: 배치작업관리 삭제
- * @param vo void 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 7. 13. - */ - public void removeProc(XitBatchRegMngVO vo); - - /** - *
메소드 설명: 배치작업관리 다건 삭제
- * @param ids void 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 7. 13. - */ - public void removesProc(String ids); - - -} diff --git a/src/main/java/cokr/xit/fims/framework/biz/mng/batch/service/XitBatchResultMngService.java b/src/main/java/cokr/xit/fims/framework/biz/mng/batch/service/XitBatchResultMngService.java deleted file mode 100644 index b1da4dee..00000000 --- a/src/main/java/cokr/xit/fims/framework/biz/mng/batch/service/XitBatchResultMngService.java +++ /dev/null @@ -1,80 +0,0 @@ -package cokr.xit.fims.framework.biz.mng.batch.service; - -import cokr.xit.fims.framework.biz.mng.batch.XitBatchResultMngSearchVO; -import cokr.xit.fims.framework.biz.mng.batch.XitBatchResultMngVO; - -import java.util.List; - -/** - * - * @업무그룹명: 배치결과관리 Service - * @설명: - * @최초작성일: 2020. 7. 13. 오후 5:04:26 - * @최초작성자: 박민규 - * @author (주)엑스아이티 개발팀 - * @since 2002. 2. 2. - * @version 1.0 Copyright(c) XIT All rights reserved. - */ -public interface XitBatchResultMngService { - - - /** - *
메소드 설명: 배치결과관리 목록 조회
- * @param searchVO - * @return List 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 7. 13. - */ - public List findList(XitBatchResultMngSearchVO searchVO); - - /** - *
메소드 설명: 배치결과관리 목록 총건수 조회
- * @param searchVO - * @return int 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 7. 13. - */ - public int findListTotCnt(XitBatchResultMngSearchVO searchVO); - - /** - *
메소드 설명: 배치결과관리 상세정보 조회
- * @param vo - * @return XitBatchResultMngVO 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 7. 13. - */ - public XitBatchResultMngVO findView(XitBatchResultMngVO vo); - - /** - *
메소드 설명: 배치결과관리 등록
- * @param vo void 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 7. 13. - */ - public void addProc(XitBatchResultMngVO vo); - - /** - *
메소드 설명: 배치결과관리 수정
- * @param vo void 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 7. 13. - */ - public void modifyProc(XitBatchResultMngVO vo); - - /** - *
메소드 설명: 배치결과관리 삭제
- * @param vo void 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 7. 13. - */ - public void removeProc(XitBatchResultMngVO vo); - - /** - *
메소드 설명: 배치결과관리 다건 삭제
- * @param ids void 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 7. 13. - */ - public void removesProc(String ids); - -} diff --git a/src/main/java/cokr/xit/fims/framework/biz/mng/batch/service/XitBatchScheduleMngService.java b/src/main/java/cokr/xit/fims/framework/biz/mng/batch/service/XitBatchScheduleMngService.java deleted file mode 100644 index db995a96..00000000 --- a/src/main/java/cokr/xit/fims/framework/biz/mng/batch/service/XitBatchScheduleMngService.java +++ /dev/null @@ -1,100 +0,0 @@ -package cokr.xit.fims.framework.biz.mng.batch.service; - -import cokr.xit.fims.framework.biz.mng.batch.XitBatchResultMngVO; -import cokr.xit.fims.framework.biz.mng.batch.XitBatchScheduleMngSearchVO; -import cokr.xit.fims.framework.biz.mng.batch.XitBatchScheduleMngVO; - -import java.util.List; - -/** - * - * @업무그룹명: 배치스케줄관리 Service - * @설명: - * @최초작성일: 2020. 7. 13. 오후 5:05:14 - * @최초작성자: 박민규 - * @author (주)엑스아이티 개발팀 - * @since 2002. 2. 2. - * @version 1.0 Copyright(c) XIT All rights reserved. - */ -public interface XitBatchScheduleMngService { - - - /** - *
메소드 설명: 배치스케줄관리 목록 조회
- * @param searchVO - * @return List 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 7. 13. - */ - public List findList(XitBatchScheduleMngSearchVO searchVO); - - /** - *
메소드 설명: 배치스케줄관리 목록 총건수 조회
- * @param searchVO - * @return int 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 7. 13. - */ - public int findListTotCnt(XitBatchScheduleMngSearchVO searchVO); - - /** - *
메소드 설명: 배치스케줄관리 상세정보 조회
- * @param vo - * @return XitBatchScheduleMngVO 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 7. 13. - */ - public XitBatchScheduleMngVO findView(XitBatchScheduleMngVO vo); - - /** - *
메소드 설명: 배치스케줄관리 등록
- * @param vo void 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 7. 13. - */ - public void addProc(XitBatchScheduleMngVO vo); - - /** - *
메소드 설명: 배치스케줄관리 수정
- * @param vo void 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 7. 13. - */ - public void modifyProc(XitBatchScheduleMngVO vo); - - /** - *
메소드 설명: 배치스케줄관리 삭제
- * @param vo void 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 7. 13. - */ - public void removeProc(XitBatchScheduleMngVO vo); - - /** - *
메소드 설명: 배치스케줄관리 다건 삭제
- * @param ids void 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 7. 13. - */ - public void removesProc(String ids); - - - - - - /** - *
메소드 설명: 배치결과 등록
- * @param ids void 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 7. 13. - */ - public void addBatchResult(XitBatchResultMngVO vo); - /** - *
메소드 설명: 배치결과 수정
- * @param ids void 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 7. 13. - */ - public void modifyBatchResult(XitBatchResultMngVO vo); - -} diff --git a/src/main/java/cokr/xit/fims/framework/biz/mng/batch/service/bean/XitBatchRegMngServiceBean.java b/src/main/java/cokr/xit/fims/framework/biz/mng/batch/service/bean/XitBatchRegMngServiceBean.java deleted file mode 100644 index a7f75c46..00000000 --- a/src/main/java/cokr/xit/fims/framework/biz/mng/batch/service/bean/XitBatchRegMngServiceBean.java +++ /dev/null @@ -1,157 +0,0 @@ -package cokr.xit.fims.framework.biz.mng.batch.service.bean; - -import cokr.xit.foundation.component.AbstractServiceBean; -import cokr.xit.fims.framework.biz.cmm.XitComtnbatchopertVO; -import cokr.xit.fims.framework.biz.cmm.service.XitFrameCrudService; -import cokr.xit.fims.framework.biz.mng.batch.dao.XitBatchRegMngMapper; -import cokr.xit.fims.framework.biz.mng.batch.XitBatchRegMngSearchVO; -import cokr.xit.fims.framework.biz.mng.batch.XitBatchRegMngVO; -import cokr.xit.fims.framework.biz.mng.batch.service.XitBatchRegMngService; -import cokr.xit.fims.framework.core.message.XitMessageSource; -import org.egovframe.rte.fdl.cmmn.exception.FdlException; -import org.egovframe.rte.fdl.idgnr.EgovIdGnrService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.sql.SQLException; -import java.util.List; - -@Service -public class XitBatchRegMngServiceBean extends AbstractServiceBean implements XitBatchRegMngService { - - @Resource - private XitBatchRegMngMapper xitBatchRegMngMapper; - @Resource - private XitFrameCrudService xitFrameCrudService; - @Autowired - @Qualifier("xitBatchOpertIdGnrService") - private EgovIdGnrService xitBatchOpertIdGnrService; - @Resource - private XitMessageSource xitMessageSource; - - @Override - public List findList(XitBatchRegMngSearchVO searchVO) { - List result = null; - try { - result = xitBatchRegMngMapper.findList(searchVO); - } catch (SQLException e) { - throw new RuntimeException("배치작업관리 목록 조회 FAIL::", e); - } - return result; - } - - @Override - public int findListTotCnt(XitBatchRegMngSearchVO searchVO) { - int result = 0; - try { - result = xitBatchRegMngMapper.findListTotCnt(searchVO); - } catch (SQLException e) { - throw new RuntimeException("배치작업관리 목록 총건수 조회 FAIL::", e); - } - return result; - } - - @Override - public XitBatchRegMngVO findView(XitBatchRegMngVO vo) { - XitBatchRegMngVO result = null; - try { - result = xitBatchRegMngMapper.findView(vo); - } catch (SQLException e) { - throw new RuntimeException("배치작업관리 상세정보 조회 FAIL::", e); - } - return result; - } - - @Override - public void addProc(XitBatchRegMngVO vo) { - /** - * 필수값 설정 - */ - try { - vo.setBatchOpertId(xitBatchOpertIdGnrService.getNextStringId()); - } catch (FdlException e) { - throw new RuntimeException(String.format("%s %s", xitMessageSource.getMessage("fail.common.insert"), e.getMessage())); - } - XitComtnbatchopertVO crudVO = convertToCrudVO(vo); - crudVO.setUseYn("Y"); - crudVO.setRgtr (vo.getRgtr()); - crudVO.setMdfr (vo.getMdfr()); - - - /** - * 처리 - */ - xitFrameCrudService.addComtnbatchopert(crudVO); - } - - @Override - public void modifyProc(XitBatchRegMngVO vo) { - /** - * 필수값 설정 - */ - XitComtnbatchopertVO crudVO = convertToCrudVO(vo); - crudVO.setMdfr (vo.getMdfr()); - - - /** - * 처리 - */ - xitFrameCrudService.modifyComtnbatchopert(crudVO); - - } - - @Override - public void removeProc(XitBatchRegMngVO vo) { - /** - * 필수값 설정 - */ - XitComtnbatchopertVO crudVO = convertToCrudVO(vo); - crudVO.setMdfr (vo.getMdfr()); - crudVO.setUseYn("N"); - - /** - * 처리 - */ - xitFrameCrudService.modifyComtnbatchopert(crudVO); - } - - @Override - public void removesProc(String ids) { - /** - * 처리 - */ - String [] primaryKey = ids.split(";"); - for(int i=0; i - * 메소드 설명: 메뉴VO를 CRUD Service의 VO로 변환 한다. - *
- * - * @return XitComtnbatchopertVO 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 7. 13. - */ - private XitComtnbatchopertVO convertToCrudVO(XitBatchRegMngVO vo) { - XitComtnbatchopertVO crudVO = new XitComtnbatchopertVO(); - crudVO.setBatchOpertId (vo.getBatchOpertId()); //배치작업ID - crudVO.setBatchOpertNm (vo.getBatchOpertNm()); //배치작업명 - crudVO.setBatchOpertSe (vo.getBatchOpertSe()); //배치작업유형 - crudVO.setBatchProgrm (vo.getBatchProgrm()); //배치프로그램 - crudVO.setParamtr (vo.getParamtr()); //파라미터 -// crudVO.setUseYn (vo.getUseYn()); //사용여부 -// crudVO.setRgtr (vo.getRgtr());//최초등록자ID -// crudVO.setReg_dt(); //최초등록시점 -// crudVO.setMdfr (vo.getMdfr()); //최종수정자ID -// crudVO.setMdfcn_dt (); //최종수정시점 - - return crudVO; - } -} diff --git a/src/main/java/cokr/xit/fims/framework/biz/mng/batch/service/bean/XitBatchResultMngServiceBean.java b/src/main/java/cokr/xit/fims/framework/biz/mng/batch/service/bean/XitBatchResultMngServiceBean.java deleted file mode 100644 index b9512f78..00000000 --- a/src/main/java/cokr/xit/fims/framework/biz/mng/batch/service/bean/XitBatchResultMngServiceBean.java +++ /dev/null @@ -1,144 +0,0 @@ -package cokr.xit.fims.framework.biz.mng.batch.service.bean; - -import cokr.xit.foundation.component.AbstractServiceBean; -import cokr.xit.fims.framework.biz.cmm.XitComtnbatchresultVO; -import cokr.xit.fims.framework.biz.cmm.service.XitFrameCrudService; -import cokr.xit.fims.framework.biz.mng.batch.dao.XitBatchResultMngMapper; -import cokr.xit.fims.framework.biz.mng.batch.XitBatchResultMngSearchVO; -import cokr.xit.fims.framework.biz.mng.batch.XitBatchResultMngVO; -import cokr.xit.fims.framework.biz.mng.batch.service.XitBatchResultMngService; -import cokr.xit.fims.framework.core.message.XitMessageSource; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.sql.SQLException; -import java.util.List; - -@Service -public class XitBatchResultMngServiceBean extends AbstractServiceBean implements XitBatchResultMngService{ - - @Resource - private XitBatchResultMngMapper xitBatchResultMngMapper; - @Resource - private XitFrameCrudService xitFrameCrudService; - @Resource - private XitMessageSource xitMessageSource; - - @Override - public List findList(XitBatchResultMngSearchVO searchVO) { - List result = null; - try { - result = xitBatchResultMngMapper.findList(searchVO); - } catch (SQLException e) { - throw new RuntimeException("배치결과관리 목록 조회 FAIL::", e); - } - return result; - } - - @Override - public int findListTotCnt(XitBatchResultMngSearchVO searchVO) { - int result = 0; - try { - result = xitBatchResultMngMapper.findListTotCnt(searchVO); - } catch (SQLException e) { - throw new RuntimeException("배치결과관리 목록 총건수 조회 FAIL::", e); - } - return result; - } - - @Override - public XitBatchResultMngVO findView(XitBatchResultMngVO vo) { - XitBatchResultMngVO result = null; - try { - result = xitBatchResultMngMapper.findView(vo); - } catch (SQLException e) { - throw new RuntimeException("배치결과관리 상세정보 조회 FAIL::", e); - } - return result; - } - - @Override - public void addProc(XitBatchResultMngVO vo) { - /** - * 필수값 설정 - */ - XitComtnbatchresultVO crudVO = convertToCrudVO(vo); - crudVO.setRgtr (vo.getRgtr()); - crudVO.setMdfr (vo.getMdfr()); - - - /** - * 처리 - */ - xitFrameCrudService.addComtnbatchresult(crudVO); - } - - @Override - public void modifyProc(XitBatchResultMngVO vo) { - /** - * 필수값 설정 - */ - XitComtnbatchresultVO crudVO = convertToCrudVO(vo); - crudVO.setMdfr (vo.getMdfr()); - - - /** - * 처리 - */ - xitFrameCrudService.modifyComtnbatchresult(crudVO); - - } - - @Override - public void removeProc(XitBatchResultMngVO vo) { - /** - * 필수값 설정 - */ - XitComtnbatchresultVO crudVO = convertToCrudVO(vo); - - /** - * 처리 - */ - xitFrameCrudService.removeComtnbatchresult(crudVO); - } - - @Override - public void removesProc(String ids) { - /** - * 처리 - */ - String [] primaryKey = ids.split(";"); - for(int i=0; i - * 메소드 설명: 메뉴VO를 CRUD Service의 VO로 변환 한다. - * - * - * @return XitComtnbatchresultVO 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 7. 13. - */ - private XitComtnbatchresultVO convertToCrudVO(XitBatchResultMngVO vo) { - XitComtnbatchresultVO crudVO = new XitComtnbatchresultVO(); - crudVO.setBatchResultId (vo.getBatchResultId()); //배치결과ID - crudVO.setBatchSchdulId (vo.getBatchSchdulId()); //배치일정ID - crudVO.setBatchOpertId (vo.getBatchOpertId()); //배치작업ID - crudVO.setParamtr (vo.getParamtr()); //파라미터 - crudVO.setSttus (vo.getSttus()); //상태 - crudVO.setErrorInfo (vo.getErrorInfo()); //오류정보 - crudVO.setExecutBeginTm (vo.getExecutBeginTime()); //실행시작시각 - crudVO.setExecutEndTm (vo.getExecutEndTime()); //실행종료시각 -// crudVO.setMdfcn_dt (vo.get); //최종수정시점 -// crudVO.setMdfr (vo.get); //최종수정자ID -// crudVO.setReg_dt(vo.get); //최초등록시점 -// crudVO.setRgtr (vo.get); //최초등록ID - - return crudVO; - } -} diff --git a/src/main/java/cokr/xit/fims/framework/biz/mng/batch/service/bean/XitBatchScheduleMngServiceBean.java b/src/main/java/cokr/xit/fims/framework/biz/mng/batch/service/bean/XitBatchScheduleMngServiceBean.java deleted file mode 100644 index 48f79a27..00000000 --- a/src/main/java/cokr/xit/fims/framework/biz/mng/batch/service/bean/XitBatchScheduleMngServiceBean.java +++ /dev/null @@ -1,228 +0,0 @@ -package cokr.xit.fims.framework.biz.mng.batch.service.bean; - -import cokr.xit.foundation.component.AbstractServiceBean; -import cokr.xit.fims.framework.biz.cmm.XitComtnbatchschdulVO; -import cokr.xit.fims.framework.biz.cmm.XitComtnbatchschduldfkVO; -import cokr.xit.fims.framework.biz.cmm.service.XitFrameCrudService; -import cokr.xit.fims.framework.biz.mng.batch.dao.XitBatchScheduleMngMapper; -import cokr.xit.fims.framework.biz.mng.batch.XitBatchResultMngVO; -import cokr.xit.fims.framework.biz.mng.batch.XitBatchScheduleDayOfWeekVO; -import cokr.xit.fims.framework.biz.mng.batch.XitBatchScheduleMngSearchVO; -import cokr.xit.fims.framework.biz.mng.batch.XitBatchScheduleMngVO; -import cokr.xit.fims.framework.biz.mng.batch.service.XitBatchResultMngService; -import cokr.xit.fims.framework.biz.mng.batch.service.XitBatchScheduleMngService; -import cokr.xit.fims.framework.core.message.XitMessageSource; -import org.egovframe.rte.fdl.cmmn.exception.FdlException; -import org.egovframe.rte.fdl.idgnr.EgovIdGnrService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; -import java.sql.SQLException; -import java.util.List; - -@Service -public class XitBatchScheduleMngServiceBean extends AbstractServiceBean implements XitBatchScheduleMngService { - - @Resource - private XitBatchScheduleMngMapper xitBatchScheduleMngMapper; - @Resource - private XitFrameCrudService xitFrameCrudService; - @Autowired - @Qualifier("xitBatchSchdulIdGnrService") - private EgovIdGnrService xitBatchSchdulIdGnrService; - @Resource - private XitMessageSource xitMessageSource; - @Resource - private XitBatchResultMngService xitBatchResultMngService; - - @Override - public List findList(XitBatchScheduleMngSearchVO searchVO) { - List result = null; - try { - result = xitBatchScheduleMngMapper.findList(searchVO); - } catch (SQLException e) { - throw new RuntimeException("배치스케줄관리 목록 조회 FAIL::", e); - } - for (int i = 0; i < result.size(); i++) { - XitBatchScheduleMngVO vo = result.get(i); - // 스케줄요일정보를 가져온다. - List dfkSeList = xitBatchScheduleMngMapper.findsBatchSchedule(vo); - String [] dfkSes = new String [dfkSeList.size()]; - for (int j = 0; j < dfkSeList.size(); j++) { - dfkSes[j] = (String) dfkSeList.get(j).getExecutSchdulDfkSe(); - } - vo.setExecutSchdulDfkSes(dfkSes); - // 화면표시용 실행스케줄 속성을 만든다. - vo.makeExecutSchdul(dfkSeList); - } - - - return result; - } - - @Override - public int findListTotCnt(XitBatchScheduleMngSearchVO searchVO) { - int result = 0; - try { - result = xitBatchScheduleMngMapper.findListTotCnt(searchVO); - } catch (SQLException e) { - throw new RuntimeException("배치스케줄관리 목록 총건수 조회 FAIL::", e); - } - return result; - } - - @Override - public XitBatchScheduleMngVO findView(XitBatchScheduleMngVO vo) { - XitBatchScheduleMngVO result = null; - try { - result = xitBatchScheduleMngMapper.findView(vo); - - // 스케줄요일정보를 가져온다. - List dfkSeList = xitBatchScheduleMngMapper.findsBatchSchedule(result); - String [] dfkSes = new String [dfkSeList.size()]; - for (int j = 0; j < dfkSeList.size(); j++) { - dfkSes[j] = (String) dfkSeList.get(j).getExecutSchdulDfkSe(); - } - result.setExecutSchdulDfkSes(dfkSes); - // 화면표시용 실행스케줄 속성을 만든다. - result.makeExecutSchdul(dfkSeList); - } catch (SQLException e) { - throw new RuntimeException("배치스케줄관리 상세정보 조회 FAIL::", e); - } - return result; - } - - @Override - public void addProc(XitBatchScheduleMngVO vo) { - /** - * 필수값 설정 - */ - try { - vo.setBatchSchdulId(xitBatchSchdulIdGnrService.getNextStringId()); - } catch (FdlException e) { - throw new RuntimeException(String.format("%s %s", xitMessageSource.getMessage("fail.common.insert"), e.getMessage())); - } - XitComtnbatchschdulVO crudVO = convertToCrudVO(vo); - crudVO.setRgtr (vo.getRgtr()); - crudVO.setMdfr (vo.getMdfr()); - - - /** - * 처리 - */ - //master 테이블 insert - xitFrameCrudService.addComtnbatchschdul(crudVO); - //slave 테이블 insert - if (vo.getExecutSchdulDfkSes() != null && vo.getExecutSchdulDfkSes().length != 0) { - String batchSchdulId = vo.getBatchSchdulId(); - String [] dfkSes = vo.getExecutSchdulDfkSes(); - for (int i = 0; i < dfkSes.length; i++) { - XitComtnbatchschduldfkVO slaveVO = new XitComtnbatchschduldfkVO(); - slaveVO.setBatchSchdulId(batchSchdulId); - slaveVO.setExecutSchdulDfkSe(dfkSes[i]); - xitFrameCrudService.addComtnbatchschduldfk(slaveVO); - } - } - } - - @Override - public void modifyProc(XitBatchScheduleMngVO vo) { - /** - * 필수값 설정 - */ - XitComtnbatchschdulVO crudVO = convertToCrudVO(vo); - crudVO.setMdfr (vo.getMdfr()); - - - /** - * 처리 - */ - //master 테이블 update - xitFrameCrudService.modifyComtnbatchschdul(crudVO); - // slave 테이블 삭제 - XitComtnbatchschduldfkVO slaveVO = new XitComtnbatchschduldfkVO(); - slaveVO.setBatchSchdulId(vo.getBatchSchdulId()); - xitFrameCrudService.removesComtnbatchschduldfk(slaveVO); - // slave 테이블 인서트 - if (vo.getExecutSchdulDfkSes() != null && vo.getExecutSchdulDfkSes().length != 0) { - String batchSchdulId = vo.getBatchSchdulId(); - String [] dfkSes = vo.getExecutSchdulDfkSes(); - for (int i = 0; i < dfkSes.length; i++) { - slaveVO = new XitComtnbatchschduldfkVO(); - slaveVO.setBatchSchdulId(batchSchdulId); - slaveVO.setExecutSchdulDfkSe(dfkSes[i]); - xitFrameCrudService.addComtnbatchschduldfk(slaveVO); - } - } - - } - - @Override - public void removeProc(XitBatchScheduleMngVO vo) { - /** - * 필수값 설정 - */ - XitComtnbatchschdulVO crudVO = convertToCrudVO(vo); - - /** - * 처리 - */ - // slave 테이블 삭제 - XitComtnbatchschduldfkVO slaveVO = new XitComtnbatchschduldfkVO(); - slaveVO.setBatchSchdulId(vo.getBatchSchdulId()); - xitFrameCrudService.removesComtnbatchschduldfk(slaveVO); - // master 테이블 delete - xitFrameCrudService.removesComtnbatchschdul(crudVO); - } - - @Override - public void removesProc(String ids) { - /** - * 처리 - */ - String [] primaryKey = ids.split(";"); - for(int i=0; i - * 메소드 설명: 메뉴VO를 CRUD Service의 VO로 변환 한다. - * - * - * @return XitComtnbatchschdulVO 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 7. 13. - */ - private XitComtnbatchschdulVO convertToCrudVO(XitBatchScheduleMngVO vo) { - XitComtnbatchschdulVO crudVO = new XitComtnbatchschdulVO(); - crudVO.setBatchSchdulId (vo.getBatchSchdulId()); //배치일정ID - crudVO.setBatchOpertId (vo.getBatchOpertId()); //배치작업ID - crudVO.setExecutCycle (vo.getExecutCycle()); //실행주기 - crudVO.setExecutSchdulDe (vo.getExecutSchdulDe()); //실행일정 일 - crudVO.setExecutSchdulHour (vo.getExecutSchdulHour()); //실행일정 시 - crudVO.setExecutSchdulMnt (vo.getExecutSchdulMnt()); //실행일정 분 - crudVO.setExecutSchdulSecnd(vo.getExecutSchdulSecnd()); //실행일정 초 -// crudVO.setRgtr (vo.getRgtr()); //최초등록자ID -// crudVO.setReg_dt (vo.get); //최초등록시점 -// crudVO.setMdfr (vo.getMdfr()); //최종수정자ID -// crudVO.setMdfcn_dt (vo.get); //최종수정시점 - - return crudVO; - } - - @Override - public void addBatchResult(XitBatchResultMngVO vo) { - xitBatchResultMngService.addProc(vo); - } - - @Override - public void modifyBatchResult(XitBatchResultMngVO vo) { - xitBatchResultMngService.modifyProc(vo); - } -} diff --git a/src/main/java/cokr/xit/fims/framework/biz/mng/batch/validator/BatchOpertSe.java b/src/main/java/cokr/xit/fims/framework/biz/mng/batch/validator/BatchOpertSe.java deleted file mode 100644 index b2f77e2d..00000000 --- a/src/main/java/cokr/xit/fims/framework/biz/mng/batch/validator/BatchOpertSe.java +++ /dev/null @@ -1,48 +0,0 @@ -package cokr.xit.fims.framework.biz.mng.batch.validator; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * - *
    - *
  • 업무 그룹명: 배치운영구분
  • - *
  • 설 명: 배치프로그램 종류를 기술 한다.
  • - *
  • 작성일: 2021. 10. 7. 오후 5:16:43 - *
- * - * @author 박민규 - * - */ -public enum BatchOpertSe { - - prm("프로그램") - ,mtd("메소드") - ; - private String code; - private String codeVal; - BatchOpertSe(String codeVal){ - this.code = this.name(); - this.codeVal = codeVal; - } - public String getCode() { - return this.code; - } - public String getCodeVal() { - return this.codeVal; - } - public static List> getCodeList(){ - List> list = new ArrayList>(); - for(BatchOpertSe value : BatchOpertSe.values()) { - Map mCode = new HashMap(); - mCode.put("code", value.getCode()); - mCode.put("codeVal", value.getCodeVal()); - list.add(mCode); - } - - return list; - } - -} diff --git a/src/main/java/cokr/xit/fims/framework/biz/mng/batch/validator/BatchOpertValidator.java b/src/main/java/cokr/xit/fims/framework/biz/mng/batch/validator/BatchOpertValidator.java deleted file mode 100644 index 31cf4d77..00000000 --- a/src/main/java/cokr/xit/fims/framework/biz/mng/batch/validator/BatchOpertValidator.java +++ /dev/null @@ -1,85 +0,0 @@ -package cokr.xit.fims.framework.biz.mng.batch.validator; - -import cokr.xit.fims.framework.biz.mng.batch.XitBatchRegMngVO; -import org.springframework.stereotype.Component; -import org.springframework.validation.Errors; -import org.springframework.validation.Validator; - -import java.io.File; - -/** - * BatchOpert클래스에대한 validator 클래스. - * common validator가 처리하지 못하는 부분 검사. - * - * @author 김진만 - * @version 1.0 - * @see - *
- * == 개정이력(Modification Information) ==
- *
- *   수정일       수정자           수정내용
- *  -------     --------    ---------------------------
- *  2010.08.20   김진만     최초 생성
- * 
- */ -@Component -public class BatchOpertValidator implements Validator { - - /* - * (non-Javadoc) - * @see org.springframework.validation.Validator#supports(java.lang.Class) - */ - @Override - public boolean supports(Class clazz) { - return XitBatchRegMngVO.class.isAssignableFrom(clazz); - } - - /* - * (non-Javadoc) - * @see org.springframework.validation.Validator#validate(java.lang.Object, org.springframework.validation.Errors) - */ - @Override - public void validate(Object obj, Errors errors) { - // 배치프로그램으로 지정된 값이 파일로 존재하는지 검사한다. - XitBatchRegMngVO batchOpert = (XitBatchRegMngVO) obj; - switch (BatchOpertSe.valueOf(batchOpert.getBatchOpertSe())) { - case prm: - //KISA 보안약점 조치 (2018-10-29, 윤창원) - File file = new File(this.filePathBlackList(batchOpert.getBatchProgrm())); - try { - if (!file.exists()) { - errors.rejectValue("batchProgrm", "errors.batchProgrm", new Object[] { batchOpert.getBatchProgrm() }, "배치프로그램 {0}이 존재하지 않습니다."); - return; - } - if (!file.isFile()) { - errors.rejectValue("batchProgrm", "errors.batchProgrm", new Object[] { batchOpert.getBatchProgrm() }, "배치프로그램 {0}이 파일이 아닙니다."); - return; - } - } catch (SecurityException se) { - errors.rejectValue("batchProgrm", "errors.batchProgrm", new Object[] { batchOpert.getBatchProgrm() }, " 배치프로그램 {0}에 접근할 수 없습니다. 파일접근권한을 확인하세요."); - } - break; - case mtd: - break; - - default: - errors.rejectValue("batchProgrm", "errors.batchProgrm", new Object[] { batchOpert.getBatchProgrm() }, "유효하지 않은 배치작업유형{0} 입니다. 배치작업유형을 확인하세요."); - break; - } - - - } - - - private String filePathBlackList(String value) { - String returnValue = value; - if (returnValue == null || returnValue.trim().equals("")) { - return ""; - } - - returnValue = returnValue.replaceAll("\\.\\.", ""); - - return returnValue; - } - -} diff --git a/src/main/java/cokr/xit/fims/framework/biz/mng/batch/web/XitBatchRegMngController.java b/src/main/java/cokr/xit/fims/framework/biz/mng/batch/web/XitBatchRegMngController.java deleted file mode 100644 index 3c360b29..00000000 --- a/src/main/java/cokr/xit/fims/framework/biz/mng/batch/web/XitBatchRegMngController.java +++ /dev/null @@ -1,367 +0,0 @@ -package cokr.xit.fims.framework.biz.mng.batch.web; - -import cokr.xit.foundation.web.AbstractController; -import cokr.xit.fims.framework.biz.cmm.XitLoginVO; -import cokr.xit.fims.framework.biz.cmm.service.XitFrameCodeService; -import cokr.xit.fims.framework.biz.mng.batch.XitBatchRegMngSearchVO; -import cokr.xit.fims.framework.biz.mng.batch.XitBatchRegMngVO; -import cokr.xit.fims.framework.biz.mng.batch.service.XitBatchRegMngService; -import cokr.xit.fims.framework.biz.mng.batch.validator.BatchOpertSe; -import cokr.xit.fims.framework.biz.mng.batch.validator.BatchOpertValidator; -import cokr.xit.fims.framework.core.constants.FrameworkConstants; -import cokr.xit.fims.framework.core.constants.FrameworkConstants.TILES_TYPE; -import cokr.xit.fims.framework.core.message.XitMessageSource; -import cokr.xit.fims.framework.core.utils.XitCmmnUtil; -import cokr.xit.fims.framework.core.validation.XitBeanValidator; -import cokr.xit.fims.framework.support.util.AjaxUtils; -import org.egovframe.rte.fdl.security.userdetails.util.EgovUserDetailsHelper; -import org.egovframe.rte.ptl.mvc.tags.ui.pagination.PaginationInfo; -import org.springframework.beans.factory.annotation.Autowired; -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.*; -import org.springframework.web.bind.support.SessionStatus; - -import javax.annotation.Resource; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * - * @업무그룹명: 배치작업관리 Controller - * @설명: - * @최초작성일: 2020. 7. 13. 오후 5:02:43 - * @최초작성자: 박민규 - * @author (주)엑스아이티 개발팀 - * @since 2002. 2. 2. - * @version 1.0 Copyright(c) XIT All rights reserved. - */ -@Controller -@RequestMapping(name = "", value = "/framework/biz/mng/batch/") -public class XitBatchRegMngController extends AbstractController { - - @Resource - private XitBatchRegMngService xitBatchRegMngService; - @Resource - private XitFrameCodeService xitFrameCodeService; - @Autowired - private XitBeanValidator beanValidator; - @Resource//(name = "xitMessageSource") - XitMessageSource xitMessageSource; - /* batchOpert bean validator */ - @Resource//(name = "batchOpertValidator") - private BatchOpertValidator batchOpertValidator; - - - - /** - *
메소드 설명: 배치작업관리 목록 페이지
- * @return String 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 7. 13. - */ - @RequestMapping(name = "", value = "batchRegMng_list", method={RequestMethod.GET, RequestMethod.POST}) - public String batchRegMng_list(@ModelAttribute("searchVO") XitBatchRegMngSearchVO searchVO, ModelMap model) { - - - - return FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/batch/XitBatchRegMng_list"; - } - - /** - *
메소드 설명: 배치작업 관리 페이지 조회
- * @return String 요청처리 후 응답객체 - * @author: 김동규 - * @date: 2020. 7. 31. - */ - @RequestMapping(name = "", value = "batchRegMng_list.ajax", method={RequestMethod.GET, RequestMethod.POST}) - @ResponseBody - public Map batchRegMng_listAjax(@ModelAttribute("searchVO") XitBatchRegMngSearchVO searchVO, ModelMap model) { - - /** paging */ - PaginationInfo paginationInfo = new PaginationInfo(); - paginationInfo.setCurrentPageNo(searchVO.getPageNum()>-1?searchVO.getPageNum():searchVO.getPageIndex()); - paginationInfo.setRecordCountPerPage(searchVO.getFetchSize()>-1?searchVO.getFetchSize():searchVO.getPageUnit()); - paginationInfo.setPageSize(searchVO.getPageSize()); - searchVO.setFirstIndex(paginationInfo.getFirstRecordIndex()); - searchVO.setLastIndex(paginationInfo.getLastRecordIndex()); - searchVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage()); - - Map resultMap = new HashMap(); - try { - /** - * 조회 - */ - List resultList = xitBatchRegMngService.findList(searchVO); - int totCnt = xitBatchRegMngService.findListTotCnt(searchVO); - /** - * 반환값 설정 - */ - /* *************************** - * tui Grid Response Set - *************************** */ - resultMap.put("result", true); //[tui Grid] result - resultMap.put("message", xitMessageSource.getMessage("success.common.select")); //[tui Grid] result message - Map data = new HashMap(); - data.put("contents", resultList); //[tui Grid] data-contents - Map pagination = new HashMap(); - pagination.put("pageNum", searchVO.getPageNum()); - pagination.put("totalSize", totCnt); - data.put("pagination", pagination); //[tui Grid] data-paging - resultMap.put("data", data); //[tui Grid] data - /* *************************** - * //tui Grid Response Set - *************************** */ - } catch (Exception e) { - /** - * 반환값 설정 - */ - //tui Grid Response Set - resultMap.put("result", false); //[tui Grid] result - resultMap.put("message", xitMessageSource.getMessage("fail.common.select")); //[tui Grid] result message - } - - - return resultMap; - } - - /** - *
메소드 설명: 요청 페이지로 이동 한다.
- * @param page - * @param tilesDef 타일즈 적용 Type(none: tiles 미적용) - * @param model - * @return String 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 7. 13. - */ - @RequestMapping(name = "", value = "batchRegMng_{cmd}", method={RequestMethod.GET, RequestMethod.POST}) - public String batchRegMng_page(@PathVariable String cmd - , @RequestParam(value="tilesDef", required=false, defaultValue="") String tilesDef - , @ModelAttribute("vo") XitBatchRegMngVO vo - , @ModelAttribute("searchVO") XitBatchRegMngSearchVO searchVO - , ModelMap model) { - switch (cmd) { - case "input": //등록 페이지 - model.addAttribute("batchOpert", vo); - model.addAttribute("batchOpertSeCodeList", BatchOpertSe.getCodeList()); - break; - - case "edit": //수정 페이지 - model.addAttribute("batchOpert", xitBatchRegMngService.findView(vo)); - model.addAttribute("message", xitMessageSource.getMessage("success.common.select")); - model.addAttribute("batchOpertSeCodeList", BatchOpertSe.getCodeList()); - break; - - case "view": //상세 페이지 - model.addAttribute("resultInfo", xitBatchRegMngService.findView(vo)); - model.addAttribute("message", xitMessageSource.getMessage("success.common.select")); - model.addAttribute("batchOpertSeCodeList", BatchOpertSe.getCodeList()); - break; - default: - throw new RuntimeException("유효하지 않은 요청 입니다."); - } - - - if(!"".equals(tilesDef)) - tilesDef = "."+tilesDef; - return FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/batch/XitBatchRegMng_"+cmd+tilesDef; - - } - - - /** - *
메소드 설명: 요청 팝업 페이지 이동 한다.
- * @param page - * @param model - * @return String 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 7. 13. - */ - @RequestMapping(name = "", value = "batchRegMng_{cmd}_popup", method={RequestMethod.GET, RequestMethod.POST}) - public String batchRegMng_page_popup(@PathVariable String cmd - , @ModelAttribute("vo") XitBatchRegMngVO vo - , @ModelAttribute("searchVO") XitBatchRegMngSearchVO searchVO - , ModelMap model) { - switch (cmd) { - case "choice": // - /** paging */ - PaginationInfo paginationInfo = new PaginationInfo(); - paginationInfo.setCurrentPageNo(searchVO.getPageIndex()); - paginationInfo.setRecordCountPerPage(searchVO.getPageUnit()); - paginationInfo.setPageSize(searchVO.getPageSize()); - - searchVO.setFirstIndex(paginationInfo.getFirstRecordIndex()); - searchVO.setLastIndex(paginationInfo.getLastRecordIndex()); - searchVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage()); - - List resultList = (List) xitBatchRegMngService.findList(searchVO); - int totCnt = xitBatchRegMngService.findListTotCnt(searchVO); - - paginationInfo.setTotalRecordCount(totCnt); - - model.addAttribute("resultList", resultList); - model.addAttribute("resultCnt", totCnt); - model.addAttribute("paginationInfo", paginationInfo); - break; - default: - throw new RuntimeException("유효하지 않은 요청 입니다."); - } - - - return FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/batch/XitBatchRegMng_"+cmd+"_popup"+TILES_TYPE.POPUP.getVal(); - } - - - - /** - *
메소드 설명: 배치작업관리 CUD 처리
- * @return String 요청처리 후 응답객체 - * @author: 박민규 - * @throws IOException - * @throws ServletException - * @date: 2020. 7. 13. - */ - @RequestMapping(name = "", value = "batchRegMng_{cmd}_proc", method=RequestMethod.POST) - public void batchRegMng_cmd_proc(@PathVariable String cmd - ,@ModelAttribute("vo") XitBatchRegMngVO vo - ,@RequestParam(value="batchOpertIds", required=false, defaultValue="") String batchOpertIds - ,BindingResult bindingResult - ,SessionStatus status - ,Model model - ,HttpServletRequest request - ,HttpServletResponse response - ) throws ServletException, IOException { - - /** - * 처리 분기 - */ - XitLoginVO loginVO = (XitLoginVO) EgovUserDetailsHelper.getAuthenticatedUser(); - String sLocationUrl = "forward:/framework/biz/mng/batch/batchRegMng_list"; - String message = null; - switch (cmd) { - case "insert": //등록 - //유효성 확인 - //2020.11.24. 주석처리 - beanValidator.validate(vo, bindingResult); -// beanValidator.validate("batchOpert", vo, bindingResult); - batchOpertValidator.validate(vo, bindingResult); - if (bindingResult.hasErrors()) { - message = xitMessageSource.getMessage("fail.common.insert"); - sLocationUrl = "forward:/framework/biz/mng/batch/batchRegMng_input"; - break; - } - //처리 - try { - vo.setRgtr(loginVO.getUniqId()); - vo.setMdfr(loginVO.getUniqId()); - xitBatchRegMngService.addProc(vo); - status.setComplete(); - message = xitMessageSource.getMessage("success.common.insert"); - sLocationUrl = "redirect:/framework/biz/mng/batch/batchRegMng_list.do"; - } catch (RuntimeException e) { - message = e.getMessage(); - sLocationUrl = "forward:/framework/biz/mng/batch/batchRegMng_input.do"; - } catch (Exception e) { - message = xitMessageSource.getMessage("fail.common.insert"); - sLocationUrl = "forward:/framework/biz/mng/batch/batchRegMng_input.do"; - } - break; - -// case "inserts": //다건 등록 -// break; - - case "update": //수정 - //유효성 확인 - //2020.11.24. 주석처리 - beanValidator.validate(vo, bindingResult); -// beanValidator.validate("batchOpert", vo, bindingResult); - batchOpertValidator.validate(vo, bindingResult); - if (bindingResult.hasErrors()) { - model.addAttribute("batchOpert", vo); - message = xitMessageSource.getMessage("fail.common.update"); - sLocationUrl = "forward:/framework/biz/mng/batch/batchRegMng_edit"; - break; - } - //처리 - try { - vo.setMdfr(loginVO.getUniqId()); - xitBatchRegMngService.modifyProc(vo); - status.setComplete(); - message = xitMessageSource.getMessage("success.common.update"); - } catch (RuntimeException e) { - message = e.getMessage(); - sLocationUrl = "forward:/framework/biz/mng/batch/batchRegMng_edit"; - } catch (Exception e) { - message = xitMessageSource.getMessage("fail.common.update"); - sLocationUrl = "forward:/framework/biz/mng/batch/batchRegMng_edit"; - } - break; - - case "delete": //삭제 - //처리 - try { - vo.setMdfr(loginVO.getUniqId()); - xitBatchRegMngService.removeProc(vo); - status.setComplete(); - message = xitMessageSource.getMessage("success.common.delete"); - break; - } catch (RuntimeException e) { - message = e.getMessage(); - sLocationUrl = "forward:/framework/biz/mng/batch/batchRegMng_edit"; - } catch (Exception e) { - message = xitMessageSource.getMessage("fail.common.delete"); - sLocationUrl = "forward:/framework/biz/mng/batch/batchRegMng_edit"; - } - break; - - case "deletes": //다건 삭제 - //처리 - try { - vo.setMdfr(loginVO.getUniqId()); - xitBatchRegMngService.removesProc(batchOpertIds); - status.setComplete(); - message = xitMessageSource.getMessage("success.common.delete"); - } catch (RuntimeException e) { - message = e.getMessage(); - } catch (Exception e) { - message = xitMessageSource.getMessage("fail.common.delete"); - } - break; - - default: - new RuntimeException("유효하지 않은 요청 입니다."); - } - - - - /** - * 응답 설정 - */ - /* ============================ - * 2020.09.10 박민규 - * 서버 호출 방식에 관계 없이 응답처리가 가능하도록 개선 - * -기존 호출방식도 유지하며 ajax로 서버호출 시 json 으로 응답처리가 가능하도록 개선 - * [AS-IS] 반환타입 String, return url에 "forward"구문으로 처리 - * [TO-BE] 반환타입 void, DispatchServlet으로 forward 처리, ajax 호출인 경우 json응답처리 서비스로 forward - ============================ */ - //2020.09.10 주석처리 -// model.addAttribute("message", message); -// return sLocationUrl; - model.addAttribute("message", message); - if(AjaxUtils.isAjaxRequest(request)){ //ajax 요청시 - //반환 데이터 설정 - Map resultMap = new HashMap(); - resultMap.put("message", message); - XitCmmnUtil.forwardForAjaxRequest(request, response, resultMap); - }else { //submit 요청 시 - XitCmmnUtil.forwardForSubmitRequest(request, response, sLocationUrl, model.asMap()); - } - } -} diff --git a/src/main/java/cokr/xit/fims/framework/biz/mng/batch/web/XitBatchResultMngController.java b/src/main/java/cokr/xit/fims/framework/biz/mng/batch/web/XitBatchResultMngController.java deleted file mode 100644 index 68f25eec..00000000 --- a/src/main/java/cokr/xit/fims/framework/biz/mng/batch/web/XitBatchResultMngController.java +++ /dev/null @@ -1,329 +0,0 @@ -package cokr.xit.fims.framework.biz.mng.batch.web; - -import cokr.xit.foundation.web.AbstractController; -import cokr.xit.fims.framework.biz.cmm.XitLoginVO; -import cokr.xit.fims.framework.biz.cmm.service.XitFrameCodeService; -import cokr.xit.fims.framework.biz.mng.batch.XitBatchResultMngSearchVO; -import cokr.xit.fims.framework.biz.mng.batch.XitBatchResultMngVO; -import cokr.xit.fims.framework.biz.mng.batch.service.XitBatchResultMngService; -import cokr.xit.fims.framework.core.constants.FrameworkConstants; -import cokr.xit.fims.framework.core.constants.FrameworkConstants.TILES_TYPE; -import cokr.xit.fims.framework.core.message.XitMessageSource; -import cokr.xit.fims.framework.core.utils.XitCmmnUtil; -import cokr.xit.fims.framework.core.validation.XitBeanValidator; -import cokr.xit.fims.framework.support.util.AjaxUtils; -import org.egovframe.rte.fdl.security.userdetails.util.EgovUserDetailsHelper; -import org.egovframe.rte.ptl.mvc.tags.ui.pagination.PaginationInfo; -import org.springframework.beans.factory.annotation.Autowired; -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.*; -import org.springframework.web.bind.support.SessionStatus; - -import javax.annotation.Resource; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -/** - * - * @업무그룹명: 배치결과관리 Controller - * @설명: - * @최초작성일: 2020. 7. 13. 오후 5:04:03 - * @최초작성자: 박민규 - * @author (주)엑스아이티 개발팀 - * @since 2002. 2. 2. - * @version 1.0 Copyright(c) XIT All rights reserved. - */ -@Controller -@RequestMapping(name = "", value = "/framework/biz/mng/batch/") -public class XitBatchResultMngController extends AbstractController { - - - @Resource - private XitBatchResultMngService xitBatchResultMngService; - @Resource - private XitFrameCodeService xitFrameCodeService; - @Autowired - private XitBeanValidator beanValidator; - @Resource(name = "xitMessageSource") - XitMessageSource xitMessageSource; - - - - /** - *
메소드 설명: 배치작업관리 목록 페이지
- * @return String 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 7. 13. - */ - @RequestMapping(name = "", value = "batchResultMng_list", method={RequestMethod.GET, RequestMethod.POST}) - public String batchResultMng_list(@ModelAttribute("searchVO") XitBatchResultMngSearchVO searchVO, ModelMap model) { - return FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/batch/XitBatchResultMng_list"; - } - - /** - *
메소드 설명: 배치작업관리 목록 페이지 조회
- * @return String 요청처리 후 응답객체 - * @author: 최유수 - * @date: 2020. 8. 04. - */ - @RequestMapping(name = "", value = "batchResultMng_list.ajax", method={RequestMethod.GET, RequestMethod.POST}) - @ResponseBody - public Map batchResultMng_listAjax(@ModelAttribute("searchVO") XitBatchResultMngSearchVO searchVO, ModelMap model) { - - /** paging */ - PaginationInfo paginationInfo = new PaginationInfo(); - paginationInfo.setCurrentPageNo(searchVO.getPageNum()>-1?searchVO.getPageNum():searchVO.getPageIndex()); - paginationInfo.setRecordCountPerPage(searchVO.getFetchSize()>-1?searchVO.getFetchSize():searchVO.getPageUnit()); - paginationInfo.setPageSize(searchVO.getPageSize()); - searchVO.setFirstIndex(paginationInfo.getFirstRecordIndex()); - searchVO.setLastIndex(paginationInfo.getLastRecordIndex()); - searchVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage()); - - Map resultMap = new HashMap(); - try { - /** - * 조회 - */ - int totCnt = xitBatchResultMngService.findListTotCnt(searchVO); - paginationInfo.setTotalRecordCount(totCnt); - /** - * 반환값 설정 - */ - /* *************************** - * tui Grid Response Set - *************************** */ - resultMap.put("result", true); //[tui Grid] result - resultMap.put("message", xitMessageSource.getMessage("success.common.select")); //[tui Grid] result message - Map data = new HashMap(); - data.put("contents", xitBatchResultMngService.findList(searchVO)); //[tui Grid] data-contents - Map pagination = new HashMap(); - pagination.put("pageNum", searchVO.getPageNum()); - pagination.put("totalSize", totCnt); - data.put("pagination", pagination); //[tui Grid] data-paging - resultMap.put("data", data); //[tui Grid] data - /* *************************** - * //tui Grid Response Set - *************************** */ - } catch (Exception e) { - /** - * 반환값 설정 - */ - //tui Grid Response Set - resultMap.put("result", false); //[tui Grid] result - resultMap.put("message", xitMessageSource.getMessage("fail.common.select")); //[tui Grid] result message - } - - return resultMap; - } - - - /** - *
메소드 설명: 요청 페이지로 이동 한다.
- * @param page - * @param tilesDef 타일즈 적용 Type(none: tiles 미적용) - * @param model - * @return String 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 7. 13. - */ - @RequestMapping(name = "", value = "batchResultMng_{cmd}", method={RequestMethod.GET, RequestMethod.POST}) - public String batchResultMng_page(@PathVariable String cmd - , @RequestParam(value="tilesDef", required=false, defaultValue="") String tilesDef - , @ModelAttribute("vo") XitBatchResultMngVO vo - , @ModelAttribute("searchVO") XitBatchResultMngSearchVO searchVO - , ModelMap model) { - switch (cmd) { -// case "input": //등록 페이지 -// break; - - case "edit": //수정 페이지 - model.addAttribute("resultInfo", xitBatchResultMngService.findView(vo)); - model.addAttribute("message", xitMessageSource.getMessage("success.common.select")); - break; - case "view": //상세 페이지 - break; - default: - throw new RuntimeException("유효하지 않은 요청 입니다."); - } - - - if(!"".equals(tilesDef)) - tilesDef = "."+tilesDef; - return FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/batch/XitBatchResultMng_"+cmd+tilesDef; - - } - - - /** - *
메소드 설명: 요청 팝업 페이지 이동 한다.
- * @param page - * @param model - * @return String 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 7. 13. - */ - @RequestMapping(name = "", value = "batchResultMng_{cmd}_popup", method={RequestMethod.GET, RequestMethod.POST}) - public String batchResultMng_page_popup(@PathVariable String cmd - , @ModelAttribute("vo") XitBatchResultMngVO vo - , @ModelAttribute("searchVO") XitBatchResultMngSearchVO searchVO - , ModelMap model) { - switch (cmd) { - case "": // - break; - default: - throw new RuntimeException("유효하지 않은 요청 입니다."); - } - - - return FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/batch/XitBatchResultMng_"+cmd+"_popup"+TILES_TYPE.POPUP.getVal(); - } - - - - /** - *
메소드 설명: 배치작업관리 CUD 처리
- * @return String 요청처리 후 응답객체 - * @author: 박민규 - * @throws IOException - * @throws ServletException - * @date: 2020. 7. 13. - */ - @RequestMapping(name = "", value = "batchResultMng_{cmd}_proc", method=RequestMethod.POST) - public void batchResultMng_cmd_proc(@PathVariable String cmd - ,@ModelAttribute("vo") XitBatchResultMngVO vo - ,@ModelAttribute("searchVO") XitBatchResultMngSearchVO searchVO - ,@RequestParam(value="batchResultIds", required=false, defaultValue="") String batchResultIds - ,BindingResult bindingResult - ,SessionStatus status - ,Model model - ,HttpServletRequest request - ,HttpServletResponse response - ) throws ServletException, IOException { - - /** - * 처리 분기 - */ - XitLoginVO loginVO = (XitLoginVO) EgovUserDetailsHelper.getAuthenticatedUser(); - String sLocationUrl = "forward:/framework/biz/mng/batch/batchResultMng_list"; - String message = null; - switch (cmd) { - case "insert": //등록 - //유효성 확인 - beanValidator.validate(vo, bindingResult); - if (bindingResult.hasErrors()) { - message = xitMessageSource.getMessage("fail.common.insert"); - sLocationUrl = "forward:/framework/biz/mng/batch/batchResultMng_input"; - break; - } - //처리 - try { - vo.setRgtr(loginVO.getUniqId()); - vo.setMdfr(loginVO.getUniqId()); - xitBatchResultMngService.addProc(vo); - status.setComplete(); - message = xitMessageSource.getMessage("success.common.insert"); - sLocationUrl = "redirect:/framework/biz/mng/batch/batchResultMng_list.do"; - } catch (RuntimeException e) { - message = e.getMessage(); - sLocationUrl = "forward:/framework/biz/mng/batch/batchResultMng_input.do"; - } catch (Exception e) { - message = xitMessageSource.getMessage("fail.common.insert"); - sLocationUrl = "forward:/framework/biz/mng/batch/batchResultMng_input.do"; - } - break; - -// case "inserts": //다건 등록 -// break; - - case "update": //수정 - //유효성 확인 - beanValidator.validate(vo, bindingResult); - if (bindingResult.hasErrors()) { - model.addAttribute("batchOpert", vo); - message = xitMessageSource.getMessage("fail.common.update"); - sLocationUrl = "forward:/framework/biz/mng/batch/batchResultMng_edit"; - break; - } - //처리 - try { - vo.setMdfr(loginVO.getUniqId()); - xitBatchResultMngService.modifyProc(vo); - status.setComplete(); - message = xitMessageSource.getMessage("success.common.update"); - } catch (RuntimeException e) { - message = e.getMessage(); - sLocationUrl = "forward:/framework/biz/mng/batch/batchResultMng_edit"; - } catch (Exception e) { - message = xitMessageSource.getMessage("fail.common.update"); - sLocationUrl = "forward:/framework/biz/mng/batch/batchResultMng_edit"; - } - break; - - case "delete": //삭제 - //처리 - try { - vo.setMdfr(loginVO.getUniqId()); - xitBatchResultMngService.removeProc(vo); - status.setComplete(); - message = xitMessageSource.getMessage("success.common.delete"); - break; - } catch (RuntimeException e) { - message = e.getMessage(); - sLocationUrl = "forward:/framework/biz/mng/batch/batchResultMng_edit"; - } catch (Exception e) { - message = xitMessageSource.getMessage("fail.common.delete"); - sLocationUrl = "forward:/framework/biz/mng/batch/batchResultMng_edit"; - } - break; - - case "deletes": //다건 삭제 - //처리 - try { - vo.setMdfr(loginVO.getUniqId()); - xitBatchResultMngService.removesProc(batchResultIds); - status.setComplete(); - message = xitMessageSource.getMessage("success.common.delete"); - } catch (RuntimeException e) { - message = e.getMessage(); - } catch (Exception e) { - message = xitMessageSource.getMessage("fail.common.delete"); - } - break; - - default: - new RuntimeException("유효하지 않은 요청 입니다."); - } - - - - /** - * 응답 설정 - */ - /* ============================ - * 2020.09.10 박민규 - * 서버 호출 방식에 관계 없이 응답처리가 가능하도록 개선 - * -기존 호출방식도 유지하며 ajax로 서버호출 시 json 으로 응답처리가 가능하도록 개선 - * [AS-IS] 반환타입 String, return url에 "forward"구문으로 처리 - * [TO-BE] 반환타입 void, DispatchServlet으로 forward 처리, ajax 호출인 경우 json응답처리 서비스로 forward - ============================ */ - //2020.09.10 주석처리 -// model.addAttribute("message", message); -// return sLocationUrl; - model.addAttribute("message", message); - if(AjaxUtils.isAjaxRequest(request)){ //ajax 요청시 - //반환 데이터 설정 - Map resultMap = new HashMap(); - resultMap.put("message", message); - XitCmmnUtil.forwardForAjaxRequest(request, response, resultMap); - }else { //submit 요청 시 - XitCmmnUtil.forwardForSubmitRequest(request, response, sLocationUrl, model.asMap()); - } - } -} diff --git a/src/main/java/cokr/xit/fims/framework/biz/mng/batch/web/XitBatchScheduleMngController.java b/src/main/java/cokr/xit/fims/framework/biz/mng/batch/web/XitBatchScheduleMngController.java deleted file mode 100644 index 45d912cc..00000000 --- a/src/main/java/cokr/xit/fims/framework/biz/mng/batch/web/XitBatchScheduleMngController.java +++ /dev/null @@ -1,399 +0,0 @@ -package cokr.xit.fims.framework.biz.mng.batch.web; - -import cokr.xit.foundation.web.AbstractController; -import cokr.xit.fims.framework.biz.cmm.XitLoginVO; -import cokr.xit.fims.framework.biz.cmm.service.XitFrameCodeService; -import cokr.xit.fims.framework.biz.mng.batch.XitBatchScheduleMngSearchVO; -import cokr.xit.fims.framework.biz.mng.batch.XitBatchScheduleMngVO; -import cokr.xit.fims.framework.biz.mng.batch.service.BatchScheduler; -import cokr.xit.fims.framework.biz.mng.batch.service.XitBatchScheduleMngService; -import cokr.xit.fims.framework.core.constants.FrameworkConstants; -import cokr.xit.fims.framework.core.constants.FrameworkConstants.TILES_TYPE; -import cokr.xit.fims.framework.core.XitCodeVO; -import cokr.xit.fims.framework.core.message.XitMessageSource; -import cokr.xit.fims.framework.core.utils.XitCmmnUtil; -import cokr.xit.fims.framework.core.validation.XitBeanValidator; -import cokr.xit.fims.framework.support.util.AjaxUtils; -import org.egovframe.rte.fdl.security.userdetails.util.EgovUserDetailsHelper; -import org.egovframe.rte.ptl.mvc.tags.ui.pagination.PaginationInfo; -import org.springframework.beans.factory.annotation.Autowired; -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.*; -import org.springframework.web.bind.support.SessionStatus; - -import javax.annotation.Resource; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; - -/** - * - * @업무그룹명: 배치스케줄관리 Controller - * @설명: - * @최초작성일: 2020. 7. 13. 오후 5:04:53 - * @최초작성자: 박민규 - * @author (주)엑스아이티 개발팀 - * @since 2002. 2. 2. - * @version 1.0 Copyright(c) XIT All rights reserved. - */ -@Controller -@RequestMapping(name = "", value = "/framework/biz/mng/batch/") -public class XitBatchScheduleMngController extends AbstractController { - - @Resource - private XitBatchScheduleMngService xitBatchScheduleMngService; - @Resource - private XitFrameCodeService xitFrameCodeService; - @Autowired - private XitBeanValidator beanValidator; - @Resource(name = "xitMessageSource") - XitMessageSource xitMessageSource; /** 배치스케줄러 서비스 */ - @Resource(name = "batchScheduler") - private BatchScheduler batchScheduler; - - - - /** - *
메소드 설명: 배치스케줄관리 목록 페이지
- * @return String 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 7. 13. - */ - @RequestMapping(name = "", value = "batchScheduleMng_list", method={RequestMethod.GET, RequestMethod.POST}) - public String batchScheduleMng_list(@ModelAttribute("searchVO") XitBatchScheduleMngSearchVO searchVO, ModelMap model) { - - - - return FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/batch/XitBatchScheduleMng_list"; - } - - /** - *
메소드 설명: 배치스케줄 관리 페이지 조회
- * @return String 요청처리 후 응답객체 - * @author: 김동규 - * @date: 2020. 7. 31. - */ - @RequestMapping(name = "", value = "batchScheduleMng_list.ajax", method={RequestMethod.GET, RequestMethod.POST}) - @ResponseBody - public Map batchScheduleMng_listAjax(@ModelAttribute("searchVO") XitBatchScheduleMngSearchVO searchVO, ModelMap model) { - - /** paging */ - PaginationInfo paginationInfo = new PaginationInfo(); - paginationInfo.setCurrentPageNo(searchVO.getPageNum()>-1?searchVO.getPageNum():searchVO.getPageIndex()); - paginationInfo.setRecordCountPerPage(searchVO.getFetchSize()>-1?searchVO.getFetchSize():searchVO.getPageUnit()); - paginationInfo.setPageSize(searchVO.getPageSize()); - searchVO.setFirstIndex(paginationInfo.getFirstRecordIndex()); - searchVO.setLastIndex(paginationInfo.getLastRecordIndex()); - searchVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage()); - - Map resultMap = new HashMap(); - try { - /** - * 조회 - */ - List resultList = xitBatchScheduleMngService.findList(searchVO); - int totCnt = xitBatchScheduleMngService.findListTotCnt(searchVO); - /** - * 반환값 설정 - */ - /* *************************** - * tui Grid Response Set - *************************** */ - resultMap.put("result", true); //[tui Grid] result - resultMap.put("message", xitMessageSource.getMessage("success.common.select")); //[tui Grid] result message - Map data = new HashMap(); - data.put("contents", resultList); //[tui Grid] data-contents - Map pagination = new HashMap(); - pagination.put("pageNum", searchVO.getPageNum()); - pagination.put("totalSize", totCnt); - data.put("pagination", pagination); //[tui Grid] data-paging - resultMap.put("data", data); //[tui Grid] data - /* *************************** - * //tui Grid Response Set - *************************** */ - } catch (Exception e) { - /** - * 반환값 설정 - */ - //tui Grid Response Set - resultMap.put("result", false); //[tui Grid] result - resultMap.put("message", xitMessageSource.getMessage("fail.common.select")); //[tui Grid] result message - } - - return resultMap; - } - - /** - *
메소드 설명: 요청 페이지로 이동 한다.
- * @param page - * @param tilesDef 타일즈 적용 Type(none: tiles 미적용) - * @param model - * @return String 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 7. 13. - */ - @RequestMapping(name = "", value = "batchScheduleMng_{cmd}", method={RequestMethod.GET, RequestMethod.POST}) - public String batchScheduleMng_page(@PathVariable String cmd - , @RequestParam(value="tilesDef", required=false, defaultValue="") String tilesDef - , @ModelAttribute("vo") XitBatchScheduleMngVO vo - , @ModelAttribute("searchVO") XitBatchScheduleMngSearchVO searchVO - , ModelMap model) { - switch (cmd) { - case "input": //등록 페이지 - referenceData(model); - model.addAttribute("batchSchdul", vo); - break; - - case "edit": //수정 페이지 - referenceData(model); - model.addAttribute("batchSchdul", xitBatchScheduleMngService.findView(vo)); - model.addAttribute("message", xitMessageSource.getMessage("success.common.select")); - break; - - case "view": //상세 페이지 - model.addAttribute("resultInfo", xitBatchScheduleMngService.findView(vo)); - model.addAttribute("message", xitMessageSource.getMessage("success.common.select")); - break; - default: - throw new RuntimeException("유효하지 않은 요청 입니다."); - } - - - if(!"".equals(tilesDef)) - tilesDef = "."+tilesDef; - return FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/batch/XitBatchScheduleMng_"+cmd+tilesDef; - - } - - - /** - *
메소드 설명: 요청 팝업 페이지 이동 한다.
- * @param page - * @param model - * @return String 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2020. 7. 13. - */ - @RequestMapping(name = "", value = "batchScheduleMng_{cmd}_popup", method={RequestMethod.GET, RequestMethod.POST}) - public String batchScheduleMng_page_popup(@PathVariable String cmd - , @ModelAttribute("vo") XitBatchScheduleMngVO vo - , @ModelAttribute("searchVO") XitBatchScheduleMngSearchVO searchVO - , ModelMap model) { - switch (cmd) { - case "": // - break; - default: - throw new RuntimeException("유효하지 않은 요청 입니다."); - } - - - return FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/batch/XitBatchScheduleMng_"+cmd+"_popup"+TILES_TYPE.POPUP.getVal(); - } - - - - /** - *
메소드 설명: 배치스케줄관리 CUD 처리
- * @return String 요청처리 후 응답객체 - * @author: 박민규 - * @throws IOException - * @throws ServletException - * @date: 2020. 7. 13. - */ - @RequestMapping(name = "", value = "batchScheduleMng_{cmd}_proc", method=RequestMethod.POST) - public void batchScheduleMng_cmd_proc(@PathVariable String cmd - ,@ModelAttribute("vo") XitBatchScheduleMngVO vo - ,@ModelAttribute("searchVO") XitBatchScheduleMngSearchVO searchVO - ,@RequestParam(value="batchSchdulIds", required=false, defaultValue="") String batchSchdulIds - ,BindingResult bindingResult - ,SessionStatus status - ,Model model - ,HttpServletRequest request - ,HttpServletResponse response - ) throws ServletException, IOException { - - /** - * 처리 분기 - */ - XitLoginVO loginVO = (XitLoginVO) EgovUserDetailsHelper.getAuthenticatedUser(); - String sLocationUrl = "forward:/framework/biz/mng/batch/batchScheduleMng_list"; - String message = null; - switch (cmd) { - case "insert": //등록 - //유효성 확인 - //2020.11.24. 주석처리 - beanValidator.validate(vo, bindingResult); -// beanValidator.validate("batchSchdul", vo, bindingResult); - if (bindingResult.hasErrors()) { - message = xitMessageSource.getMessage("fail.common.insert"); - sLocationUrl = "forward:/framework/biz/mng/batch/batchScheduleMng_input"; - break; - } - //처리 - try { - vo.setRgtr(loginVO.getUniqId()); - vo.setMdfr(loginVO.getUniqId()); - // 배치스케줄 등록 - xitBatchScheduleMngService.addProc(vo); - // 배치스케줄러에 스케줄정보반영 - XitBatchScheduleMngVO target = xitBatchScheduleMngService.findView(vo); - batchScheduler.insertBatchSchdul(target); - status.setComplete(); - message = xitMessageSource.getMessage("success.common.insert"); - sLocationUrl = "redirect:/framework/biz/mng/batch/batchScheduleMng_list.do"; - } catch (RuntimeException e) { - message = e.getMessage(); - sLocationUrl = "forward:/framework/biz/mng/batch/batchScheduleMng_input.do"; - } catch (Exception e) { - message = xitMessageSource.getMessage("fail.common.insert"); - sLocationUrl = "forward:/framework/biz/mng/batch/batchScheduleMng_input.do"; - } - break; - -// case "inserts": //다건 등록 -// break; - - case "update": //수정 - //유효성 확인 - //2020.11.24. 주석처리 - beanValidator.validate(vo, bindingResult); -// beanValidator.validate("batchSchdul", vo, bindingResult); - if (bindingResult.hasErrors()) { - model.addAttribute("batchOpert", vo); - message = xitMessageSource.getMessage("fail.common.update"); - sLocationUrl = "forward:/framework/biz/mng/batch/batchScheduleMng_edit"; - break; - } - //처리 - try { - vo.setMdfr(loginVO.getUniqId()); - // 배치스케줄 수정 - xitBatchScheduleMngService.modifyProc(vo); - // 배치스케줄러에 스케줄정보반영 - XitBatchScheduleMngVO target = xitBatchScheduleMngService.findView(vo); - batchScheduler.updateBatchSchdul(target); - status.setComplete(); - message = xitMessageSource.getMessage("success.common.update"); - } catch (RuntimeException e) { - message = e.getMessage(); - sLocationUrl = "forward:/framework/biz/mng/batch/batchScheduleMng_edit"; - } catch (Exception e) { - message = xitMessageSource.getMessage("fail.common.update"); - sLocationUrl = "forward:/framework/biz/mng/batch/batchScheduleMng_edit"; - } - break; - - case "delete": //삭제 - //처리 - try { - // 배치스케줄러에 스케줄정보반영 - batchScheduler.deleteBatchSchdul(vo); - // 배치스케줄 삭제 - xitBatchScheduleMngService.removeProc(vo); - status.setComplete(); - message = xitMessageSource.getMessage("success.common.delete"); - break; - } catch (RuntimeException e) { - message = e.getMessage(); - sLocationUrl = "forward:/framework/biz/mng/batch/batchScheduleMng_edit"; - } catch (Exception e) { - message = xitMessageSource.getMessage("fail.common.delete"); - sLocationUrl = "forward:/framework/biz/mng/batch/batchScheduleMng_edit"; - } - break; - - case "deletes": //다건 삭제 - //처리 - try { - xitBatchScheduleMngService.removesProc(batchSchdulIds); - status.setComplete(); - message = xitMessageSource.getMessage("success.common.delete"); - } catch (RuntimeException e) { - message = e.getMessage(); - } catch (Exception e) { - message = xitMessageSource.getMessage("fail.common.delete"); - } - break; - - default: - new RuntimeException("유효하지 않은 요청 입니다."); - } - - - - /** - * 응답 설정 - */ - /* ============================ - * 2020.09.10 박민규 - * 서버 호출 방식에 관계 없이 응답처리가 가능하도록 개선 - * -기존 호출방식도 유지하며 ajax로 서버호출 시 json 으로 응답처리가 가능하도록 개선 - * [AS-IS] 반환타입 String, return url에 "forward"구문으로 처리 - * [TO-BE] 반환타입 void, DispatchServlet으로 forward 처리, ajax 호출인 경우 json응답처리 서비스로 forward - ============================ */ - //2020.09.10 주석처리 -// model.addAttribute("message", message); -// return sLocationUrl; - model.addAttribute("message", message); - if(AjaxUtils.isAjaxRequest(request)){ //ajax 요청시 - //반환 데이터 설정 - Map resultMap = new HashMap(); - resultMap.put("message", message); - XitCmmnUtil.forwardForAjaxRequest(request, response, resultMap); - }else { //submit 요청 시 - XitCmmnUtil.forwardForSubmitRequest(request, response, sLocationUrl, model.asMap()); - } - } - - - /** - * Reference Data 를 설정한다. - * @param model 화면용spring Model객체 - * @throws Exception - */ - private void referenceData(ModelMap model) { - //DBMS종류코드목록을 코드정보로부터 조회 - List executCycleList = xitFrameCodeService.findCmmnDetailCodes("XIT047"); - model.addAttribute("executCycleList", executCycleList); - //요일구분코드목록을 코드정보로부터 조회 - List executSchdulDfkSeList = xitFrameCodeService.findCmmnDetailCodes("XIT074"); - model.addAttribute("executSchdulDfkSeList", executSchdulDfkSeList); - - // 실행스케줄 시, 분, 초 값 설정. - Map executSchdulHourList = new LinkedHashMap(); - for (int i = 0; i < 24; i++) { - if (i < 10) { - executSchdulHourList.put("0" + Integer.toString(i), "0" + Integer.toString(i)); - } else { - executSchdulHourList.put(Integer.toString(i), Integer.toString(i)); - } - } - model.addAttribute("executSchdulHourList", executSchdulHourList); - Map executSchdulMntList = new LinkedHashMap(); - for (int i = 0; i < 60; i++) { - if (i < 10) { - executSchdulMntList.put("0" + Integer.toString(i), "0" + Integer.toString(i)); - } else { - executSchdulMntList.put(Integer.toString(i), Integer.toString(i)); - } - } - model.addAttribute("executSchdulMntList", executSchdulMntList); - Map executSchdulSecndList = new LinkedHashMap(); - for (int i = 0; i < 60; i++) { - if (i < 10) { - executSchdulSecndList.put("0" + Integer.toString(i), "0" + Integer.toString(i)); - } else { - executSchdulSecndList.put(Integer.toString(i), Integer.toString(i)); - } - } - model.addAttribute("executSchdulSecndList", executSchdulSecndList); - } -} diff --git a/src/main/java/cokr/xit/fims/framework/biz/mng/bbs/service/bean/BoardBasicMgtServiceBean.java b/src/main/java/cokr/xit/fims/framework/biz/mng/bbs/service/bean/BoardBasicMgtServiceBean.java index 4ca46e90..a1f5bcf6 100644 --- a/src/main/java/cokr/xit/fims/framework/biz/mng/bbs/service/bean/BoardBasicMgtServiceBean.java +++ b/src/main/java/cokr/xit/fims/framework/biz/mng/bbs/service/bean/BoardBasicMgtServiceBean.java @@ -23,8 +23,7 @@ import java.util.Map; @Service public class BoardBasicMgtServiceBean extends AbstractServiceBean implements BoardBasicMgtService { - @Value("#{prop['file.upload.cmm-board.path']}") - private String uploadCmmBoardPath; + private String uploadCmmBoardPath = "/cmm-board"; private final BoardBasicMgtMapper mapper; diff --git a/src/main/java/cokr/xit/fims/framework/biz/mng/bbs/web/BoardBasicMgtController.java b/src/main/java/cokr/xit/fims/framework/biz/mng/bbs/web/BoardBasicMgtController.java index daff2bcd..b948db08 100644 --- a/src/main/java/cokr/xit/fims/framework/biz/mng/bbs/web/BoardBasicMgtController.java +++ b/src/main/java/cokr/xit/fims/framework/biz/mng/bbs/web/BoardBasicMgtController.java @@ -5,7 +5,7 @@ import cokr.xit.fims.framework.biz.cmm.service.CmmFileService; import cokr.xit.fims.framework.biz.mng.bbs.XitBasicBbsMngVO; import cokr.xit.fims.framework.biz.mng.bbs.service.BoardBasicMgtService; import cokr.xit.fims.framework.core.constants.FrameworkConstants; -import cokr.xit.fims.framework.core.ResultResponse; + import cokr.xit.fims.framework.support.mybatis.MybatisUtils; import cokr.xit.fims.framework.support.util.AjaxMessageMapRenderer; import cokr.xit.fims.framework.support.util.Checks; @@ -63,7 +63,7 @@ public class BoardBasicMgtController extends AbstractController { @GetMapping(name = "", value = "/findBoardBasics") public ModelAndView finsBoardBasics(@RequestParam final Map paraMap){ - return ResultResponse.of(service.findBoardBasicList(paraMap, MybatisUtils.getPagingInfo(paraMap))); + return new ModelAndView("jsonView").addObject("result",service.findBoardBasicList(paraMap, MybatisUtils.getPagingInfo(paraMap))); } @PostMapping(name = "", value = "/addBoardBasic")//, consumes = "multipart/form-data" @@ -88,6 +88,6 @@ public class BoardBasicMgtController extends AbstractController { @RequestMapping(name = "", value = "/findCmmBoardAttchFiles") public ModelAndView findCmmBoardAttchFiles(final String atchFileId) { - return ResultResponse.of(fileService.findFiles(atchFileId)); + return new ModelAndView("jsonView").addObject("result",fileService.findFiles(atchFileId)); } } diff --git a/src/main/java/cokr/xit/fims/framework/biz/mng/bbs/web/BoardCreateMgtController.java b/src/main/java/cokr/xit/fims/framework/biz/mng/bbs/web/BoardCreateMgtController.java index cff642d9..2cf5dcfa 100644 --- a/src/main/java/cokr/xit/fims/framework/biz/mng/bbs/web/BoardCreateMgtController.java +++ b/src/main/java/cokr/xit/fims/framework/biz/mng/bbs/web/BoardCreateMgtController.java @@ -4,7 +4,7 @@ import cokr.xit.foundation.web.AbstractController; import cokr.xit.fims.framework.biz.mng.bbs.XitBbsCreateMngVO; import cokr.xit.fims.framework.biz.mng.bbs.service.BoardCreateMgtService; import cokr.xit.fims.framework.core.constants.FrameworkConstants; -import cokr.xit.fims.framework.core.ResultResponse; + import cokr.xit.fims.framework.support.mybatis.MybatisUtils; import cokr.xit.fims.framework.support.util.AjaxMessageMapRenderer; import cokr.xit.fims.framework.support.util.Checks; @@ -64,7 +64,7 @@ public class BoardCreateMgtController extends AbstractController { @GetMapping(name = "", value = "/findBoardCreates") public ModelAndView finsBoardCreates(@RequestParam final Map paraMap){ - return ResultResponse.of(service.findBoardCreateList(paraMap, MybatisUtils.getPagingInfo(paraMap))); + return new ModelAndView("jsonView").addObject("result",service.findBoardCreateList(paraMap, MybatisUtils.getPagingInfo(paraMap))); } @PostMapping(name = "", value = "/addBoardCreate") diff --git a/src/main/java/cokr/xit/fims/framework/biz/mng/bbs/web/BoardTmplMgtController.java b/src/main/java/cokr/xit/fims/framework/biz/mng/bbs/web/BoardTmplMgtController.java index 314a61f6..b7630b83 100644 --- a/src/main/java/cokr/xit/fims/framework/biz/mng/bbs/web/BoardTmplMgtController.java +++ b/src/main/java/cokr/xit/fims/framework/biz/mng/bbs/web/BoardTmplMgtController.java @@ -6,7 +6,7 @@ import cokr.xit.fims.framework.biz.mng.bbs.XitBbsCreateMngVO; import cokr.xit.fims.framework.biz.mng.bbs.XitBbsTmplateMngVO; import cokr.xit.fims.framework.biz.mng.bbs.service.BoardTmplMgtService; import cokr.xit.fims.framework.core.constants.FrameworkConstants; -import cokr.xit.fims.framework.core.ResultResponse; + import cokr.xit.fims.framework.support.mybatis.MybatisUtils; import cokr.xit.fims.framework.support.util.AjaxMessageMapRenderer; import cokr.xit.fims.framework.support.util.Checks; @@ -43,10 +43,10 @@ public class BoardTmplMgtController extends AbstractController { private final BoardTmplMgtService service; - @Value("#{prop['Globals.Xit.Pagination.PageUnit']}") - private int PAGE_UNIT; - @Value("#{prop['Globals.Xit.Pagination.PageSize']}") - private int PAGE_SIZE; + + private int PAGE_UNIT = 10; + + private int PAGE_SIZE = 10; @RequestMapping(name = "", value = "/mngBoardTmplMgtPopup") @@ -108,38 +108,14 @@ public class BoardTmplMgtController extends AbstractController { list.add(target); - //master.setTmplatCours(template); - - - + ModelAndView mav = new ModelAndView(FrameworkConstants.FRAMEWORK_JSP_BASE_PATH + "mng/bbs/mngBoardTmplPreviewPopup.popup").addObject("result",list); - ModelAndView mav = ResultResponse.of(list, FrameworkConstants.FRAMEWORK_JSP_BASE_PATH + "mng/bbs/mngBoardTmplPreviewPopup.popup"); - //ModelAndView mav = ResultResponse.of(list, FrameworkConstants.FRAMEWORK_JSP_BASE_PATH + "mng/bbs/XitBasicBbsMng_list.popup"); - - //mav.addObject("resultList", list); - //mav.addObject("resultCnt", Integer.toString(list.size())); - //mav.addObject("paginationInfo", paginationInfo); - - - //mav.addObject("boardVO", vo); mav.addObject("brdMstrVO", master); mav.addObject("preview", "true"); - - - - - - - - - - - - //mav.addObject("templateInf", vo); mav.addAllObjects(paraMap); mav.addObject("pageTitle", "BBS 템플릿 미리보기"); - //mav.setViewName(FrameworkConstants.FRAMEWORK_JSP_BASE_PATH + "mng/bbs/mngBbsTmplPreviewPopup.popup"); + @@ -149,7 +125,7 @@ public class BoardTmplMgtController extends AbstractController { @GetMapping(name = "", value = "/findBoardTmpls") public ModelAndView finsBoardTmpls(@RequestParam final Map paraMap){ - return ResultResponse.of(service.findBoardTmpls(paraMap, MybatisUtils.getPagingInfo(paraMap))); + return new ModelAndView("jsonView").addObject("result",service.findBoardTmpls(paraMap, MybatisUtils.getPagingInfo(paraMap))); } @PostMapping(name = "", value = "/addBoardTmpl") diff --git a/src/main/java/cokr/xit/fims/framework/biz/mng/bbs/web/BoardUseMgtController.java b/src/main/java/cokr/xit/fims/framework/biz/mng/bbs/web/BoardUseMgtController.java index 328a21fa..29a6295f 100644 --- a/src/main/java/cokr/xit/fims/framework/biz/mng/bbs/web/BoardUseMgtController.java +++ b/src/main/java/cokr/xit/fims/framework/biz/mng/bbs/web/BoardUseMgtController.java @@ -4,7 +4,7 @@ import cokr.xit.foundation.web.AbstractController; import cokr.xit.fims.framework.biz.mng.bbs.XitBbsUseMngVO; import cokr.xit.fims.framework.biz.mng.bbs.service.BoardUseMgtService; import cokr.xit.fims.framework.core.constants.FrameworkConstants; -import cokr.xit.fims.framework.core.ResultResponse; + import cokr.xit.fims.framework.support.mybatis.MybatisUtils; import cokr.xit.fims.framework.support.util.AjaxMessageMapRenderer; import cokr.xit.fims.framework.support.util.ValidationError; @@ -40,7 +40,7 @@ public class BoardUseMgtController extends AbstractController { @GetMapping(name = "", value = "/findBoardUsePrcuseList") public ModelAndView finsBoardUsePrcuseList(@RequestParam final Map paraMap){ - return ResultResponse.of(service.findBoardPrcuseList(paraMap, MybatisUtils.getPagingInfo(paraMap))); + return new ModelAndView("jsonView").addObject("result",service.findBoardPrcuseList(paraMap, MybatisUtils.getPagingInfo(paraMap))); } @PostMapping(name = "", value = "/addBoardUsePrcuse") diff --git a/src/main/java/cokr/xit/fims/framework/biz/mng/bbs/web/XitBasicBbsMngController.java b/src/main/java/cokr/xit/fims/framework/biz/mng/bbs/web/XitBasicBbsMngController.java index 72c359f0..ebe00528 100644 --- a/src/main/java/cokr/xit/fims/framework/biz/mng/bbs/web/XitBasicBbsMngController.java +++ b/src/main/java/cokr/xit/fims/framework/biz/mng/bbs/web/XitBasicBbsMngController.java @@ -13,7 +13,7 @@ import cokr.xit.fims.framework.biz.mng.bbs.service.XitBbsCreateMngService; import cokr.xit.fims.framework.core.constants.FrameworkConstants; import cokr.xit.fims.framework.core.constants.FrameworkConstants.TILES_TYPE; import cokr.xit.fims.framework.core.XitAttachFileRespVO; -import cokr.xit.fims.framework.core.XitRollingNotiVO; + import cokr.xit.fims.framework.core.message.XitMessageSource; import cokr.xit.fims.framework.core.utils.XitCmmnUtil; import cokr.xit.fims.framework.core.utils.attachfile.XitAttachFileOptionVO; @@ -70,15 +70,14 @@ public class XitBasicBbsMngController extends AbstractController { private XitFrameUnitService xitFrameUnitService; @Resource private XitFrameCrudService xitFrameCrudService; - @Resource - private XitRollingNotiVO xitRollingNotiVO; - @Value("#{prop['Globals.Xit.Pagination.PageUnit']}") - private int PAGE_UNIT; - @Value("#{prop['Globals.Xit.Pagination.PageSize']}") - private int PAGE_SIZE; - @Value("#{prop['Globals.Xit.File.UploadPath']}") - private String FILE_UPLOAD_PATH; + + + private int PAGE_UNIT = 10; + + private int PAGE_SIZE = 10; + + private String FILE_UPLOAD_PATH="/xitframe/file/user/upload/"; /** *
메소드 설명: 기본(공용)게시판 목록 페이지
@@ -634,16 +633,6 @@ public class XitBasicBbsMngController extends AbstractController { } - /** - * Rolling 공지사항 적용 - * -공지사항 게시글의 변경 내용을 Rolling 공지사항 목록에 반영 한다. - */ - XitRollingNotiVO notiVO = xitRollingNotiVO; - if(XitCmmnUtil.notEmpty(notiVO.getBbsId())) { //BBS_ID 값이 없으면 롤링 미사용으로 간주(globals.properties의 Globals.Xit.RollingNotiBbsId 에서 설정 가능) - if(notiVO.getBbsId().equals(vo.getBbsId())) { - notiVO.setList(xitFrameUnitService.findLatestBbsList(true)); - } - } /* diff --git a/src/main/java/cokr/xit/fims/framework/biz/mng/bbs/web/XitBbsCreateMngController.java b/src/main/java/cokr/xit/fims/framework/biz/mng/bbs/web/XitBbsCreateMngController.java index c4d9bd58..a7b31a56 100644 --- a/src/main/java/cokr/xit/fims/framework/biz/mng/bbs/web/XitBbsCreateMngController.java +++ b/src/main/java/cokr/xit/fims/framework/biz/mng/bbs/web/XitBbsCreateMngController.java @@ -55,12 +55,12 @@ public class XitBbsCreateMngController extends AbstractController { @Resource(name = "xitMessageSource") XitMessageSource xitMessageSource; - @Value("#{prop['Globals.Xit.Pagination.PageUnit']}") - private int PAGE_UNIT; - @Value("#{prop['Globals.Xit.Pagination.PageSize']}") - private int PAGE_SIZE; - @Value("#{prop['Globals.Xit.File.UploadableSize']}") - private String FILE_UPLOAD_SIZE; + + private int PAGE_UNIT = 10; + + private int PAGE_SIZE = 10; + + private String FILE_UPLOAD_SIZE = "5242880"; /** *
메소드 설명: 게시판생성관리 목록 페이지
* @return String 요청처리 후 응답객체 diff --git a/src/main/java/cokr/xit/fims/framework/biz/mng/code/service/ZipCodeMgtService.java b/src/main/java/cokr/xit/fims/framework/biz/mng/code/service/ZipCodeMgtService.java deleted file mode 100644 index 02a39af7..00000000 --- a/src/main/java/cokr/xit/fims/framework/biz/mng/code/service/ZipCodeMgtService.java +++ /dev/null @@ -1,29 +0,0 @@ -package cokr.xit.fims.framework.biz.mng.code.service; - -import cokr.xit.fims.framework.biz.mng.code.XitZipCodeMngVO; -import org.apache.ibatis.session.RowBounds; - -import java.io.FileInputStream; -import java.util.List; -import java.util.Map; - -/** - * - * @업무그룹명: 우편번호관리 Service - * @설명: - * @최초작성일: 2020. 4. 16. 오전 9:38:56 - * @최초작성자: 박민규 - * @author (주)엑스아이티 개발팀 - * @since 2002. 2. 2. - * @version 1.0 Copyright(c) XIT All rights reserved. - */ -public interface ZipCodeMgtService { - - List findZipCodes(final Map paraMap, final RowBounds rowBounds); - XitZipCodeMngVO findZipCode(T t); - void addZipCode(final XitZipCodeMngVO vo); - void modifyZipCode(final XitZipCodeMngVO vo); - void removeZipcode(final XitZipCodeMngVO vo); - - void uploadZipCodeByExcel(final FileInputStream fis); -} diff --git a/src/main/java/cokr/xit/fims/framework/biz/mng/code/service/bean/ZipCodeMgtServiceBean.java b/src/main/java/cokr/xit/fims/framework/biz/mng/code/service/bean/ZipCodeMgtServiceBean.java deleted file mode 100644 index f95db43c..00000000 --- a/src/main/java/cokr/xit/fims/framework/biz/mng/code/service/bean/ZipCodeMgtServiceBean.java +++ /dev/null @@ -1,67 +0,0 @@ -package cokr.xit.fims.framework.biz.mng.code.service.bean; - -import cokr.xit.foundation.component.AbstractServiceBean; -import cokr.xit.fims.framework.biz.mng.code.dao.ZipCodeMgtMapper; -import cokr.xit.fims.framework.biz.mng.code.XitZipCodeMngVO; -import cokr.xit.fims.framework.biz.mng.code.service.ZipCodeMgtService; -import cokr.xit.fims.framework.support.exception.BizRuntimeException; -import cokr.xit.fims.framework.support.util.constants.MessageKey; -import lombok.RequiredArgsConstructor; -import org.apache.ibatis.session.RowBounds; -import org.egovframe.rte.fdl.excel.EgovExcelService; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.io.FileInputStream; -import java.util.List; -import java.util.Map; - -@RequiredArgsConstructor -@Service -public class ZipCodeMgtServiceBean extends AbstractServiceBean implements ZipCodeMgtService { - - private final ZipCodeMgtMapper mapper; - private final EgovExcelService egovExcelService; - - @Override - @Transactional(readOnly = true) - public List findZipCodes(final Map paraMap, final RowBounds rowBounds) { - return mapper.selectZips(paraMap, rowBounds); - } - - @Override - @Transactional(readOnly = true) - public XitZipCodeMngVO findZipCode(T t) { - return mapper.selectZip(t); - } - - @Override - @Transactional - public void addZipCode(final XitZipCodeMngVO vo) { - mapper.insertZip(vo); - } - - @Override - @Transactional - public void modifyZipCode(final XitZipCodeMngVO vo) { - mapper.updateZip(vo); - } - - @Override - @Transactional - public void removeZipcode(final XitZipCodeMngVO vo) { - mapper.deleteZip(vo); - } - - @Override - @Transactional(readOnly = true) - public void uploadZipCodeByExcel(FileInputStream fis) { - - //mapper.deleteAllZip(); // 데이타 모두 삭제??? - try { - egovExcelService.uploadExcel("cokr.xit.fims.framework.biz.mng.code.dao.ZipCodeMgtMapper.insertZip", fis, 2, 5000); - } catch (Exception e) { - throw BizRuntimeException.create(MessageKey.CUSTOM_MSG, e.getMessage()); - } - } -} diff --git a/src/main/java/cokr/xit/fims/framework/biz/mng/code/web/CodeCfnMgtController.java b/src/main/java/cokr/xit/fims/framework/biz/mng/code/web/CodeCfnMgtController.java index 4157221e..581d84cd 100644 --- a/src/main/java/cokr/xit/fims/framework/biz/mng/code/web/CodeCfnMgtController.java +++ b/src/main/java/cokr/xit/fims/framework/biz/mng/code/web/CodeCfnMgtController.java @@ -4,7 +4,7 @@ import cokr.xit.foundation.web.AbstractController; import cokr.xit.fims.framework.biz.mng.code.XitClCodeMngVO; import cokr.xit.fims.framework.biz.mng.code.service.CodeCfnMgtService; import cokr.xit.fims.framework.core.constants.FrameworkConstants; -import cokr.xit.fims.framework.core.ResultResponse; + import cokr.xit.fims.framework.support.mybatis.MybatisUtils; import cokr.xit.fims.framework.support.util.AjaxMessageMapRenderer; import cokr.xit.fims.framework.support.util.Checks; @@ -46,7 +46,7 @@ public class CodeCfnMgtController extends AbstractController { @GetMapping(name = "", value = "/findCodeCfns") public ModelAndView findCodeCfns(@RequestParam final Map paraMap){ - return ResultResponse.of(service.findCodeCfns(paraMap, MybatisUtils.getPagingInfo(paraMap))); + return new ModelAndView("jsonView").addObject("result",service.findCodeCfns(paraMap, MybatisUtils.getPagingInfo(paraMap))); } @PostMapping(name = "", value = "/addCodeCfn") diff --git a/src/main/java/cokr/xit/fims/framework/biz/mng/code/web/CodeDtlMgtController.java b/src/main/java/cokr/xit/fims/framework/biz/mng/code/web/CodeDtlMgtController.java index aaa8ca84..5cfb0d53 100644 --- a/src/main/java/cokr/xit/fims/framework/biz/mng/code/web/CodeDtlMgtController.java +++ b/src/main/java/cokr/xit/fims/framework/biz/mng/code/web/CodeDtlMgtController.java @@ -1,14 +1,11 @@ package cokr.xit.fims.framework.biz.mng.code.web; import cokr.xit.foundation.web.AbstractController; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; import cokr.xit.fims.framework.biz.cache.util.CacheServiceUtils; import cokr.xit.fims.framework.biz.mng.code.XitDetailCodeMngVO; import cokr.xit.fims.framework.biz.mng.code.service.CodeDtlMgtService; import cokr.xit.fims.framework.core.constants.FrameworkConstants; -import cokr.xit.fims.framework.core.ResultResponse; + import cokr.xit.fims.framework.support.mybatis.MybatisUtils; import cokr.xit.fims.framework.support.util.AjaxMessageMapRenderer; import cokr.xit.fims.framework.support.util.Checks; @@ -19,11 +16,10 @@ import org.springframework.stereotype.Controller; import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.*; import org.springframework.web.servlet.ModelAndView; -import springfox.documentation.annotations.ApiIgnore; import java.util.Map; -@Api(value="코드 상세 관리", tags = "CodeDtlMgtController") + @RequiredArgsConstructor @Controller @RequestMapping(name = "", value = "/framework/biz/mng/code") @@ -33,10 +29,9 @@ public class CodeDtlMgtController extends AbstractController { - @ApiOperation(value = "코드 상세 관리 팝업 화면") - @ApiImplicitParam(name = "grpId", value = "코드 ID", required = true, dataType = "string", paramType = "path", defaultValue = "FIM001") + @RequestMapping(name = "", value = "/mngCodeDtlMgtPopup", method= {RequestMethod.GET, RequestMethod.POST}) - public ModelAndView mngCodeDtlMgtPopup(@ApiIgnore final XitDetailCodeMngVO vo) { + public ModelAndView mngCodeDtlMgtPopup(final XitDetailCodeMngVO vo) { ModelAndView mav = new ModelAndView(); mav.addObject("cfnCodeList", CacheServiceUtils.getComboCodes(null, "CMM_CFN")); @@ -54,7 +49,7 @@ public class CodeDtlMgtController extends AbstractController { @GetMapping(name = "", value = "/findCodeDtls") public ModelAndView findCodeDtls(@RequestParam final Map paraMap){ - return ResultResponse.of(service.findCodeDtls(paraMap, MybatisUtils.getPagingInfo(paraMap))); + return new ModelAndView("jsonView").addObject("result",service.findCodeDtls(paraMap, MybatisUtils.getPagingInfo(paraMap))); } @PostMapping(name = "", value = "/addCodeDtl") //, consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE) diff --git a/src/main/java/cokr/xit/fims/framework/biz/mng/code/web/CodeGrpMgtController.java b/src/main/java/cokr/xit/fims/framework/biz/mng/code/web/CodeGrpMgtController.java index b62e7df9..e3179efa 100644 --- a/src/main/java/cokr/xit/fims/framework/biz/mng/code/web/CodeGrpMgtController.java +++ b/src/main/java/cokr/xit/fims/framework/biz/mng/code/web/CodeGrpMgtController.java @@ -4,7 +4,7 @@ import cokr.xit.foundation.web.AbstractController; import cokr.xit.fims.framework.biz.mng.code.XitCmmnCodeMngVO; import cokr.xit.fims.framework.biz.mng.code.service.CodeGrpMgtService; import cokr.xit.fims.framework.core.constants.FrameworkConstants; -import cokr.xit.fims.framework.core.ResultResponse; + import cokr.xit.fims.framework.support.mybatis.MybatisUtils; import cokr.xit.fims.framework.support.util.AjaxMessageMapRenderer; import cokr.xit.fims.framework.support.util.Checks; @@ -45,7 +45,7 @@ public class CodeGrpMgtController extends AbstractController { @GetMapping(name = "", value = "/findCodeGrps") public ModelAndView findCodeGrps(@RequestParam final Map paraMap){ - return ResultResponse.of(service.findCodeGrps(paraMap, MybatisUtils.getPagingInfo(paraMap))); + return new ModelAndView("jsonView").addObject("result",service.findCodeGrps(paraMap, MybatisUtils.getPagingInfo(paraMap))); } @PostMapping(name = "", value = "/addCodeGrp") diff --git a/src/main/java/cokr/xit/fims/framework/biz/mng/code/web/ZipCodeMgtController.java b/src/main/java/cokr/xit/fims/framework/biz/mng/code/web/ZipCodeMgtController.java deleted file mode 100644 index 251ec3a8..00000000 --- a/src/main/java/cokr/xit/fims/framework/biz/mng/code/web/ZipCodeMgtController.java +++ /dev/null @@ -1,126 +0,0 @@ -package cokr.xit.fims.framework.biz.mng.code.web; - -import cokr.xit.foundation.web.AbstractController; -import cokr.xit.fims.framework.biz.mng.code.XitZipCodeMngVO; -import cokr.xit.fims.framework.biz.mng.code.service.ZipCodeMgtService; -import cokr.xit.fims.framework.core.constants.FrameworkConstants; -import cokr.xit.fims.framework.core.ResultResponse; -import cokr.xit.fims.framework.core.utils.XitCmmnUtil; -import cokr.xit.fims.framework.core.utils.attachfile.XitAttachFileUtil; -import cokr.xit.fims.framework.core.utils.attachfile.XitAttachFileVO; -import cokr.xit.fims.framework.support.exception.BizRuntimeException; -import cokr.xit.fims.framework.support.mybatis.MybatisUtils; -import cokr.xit.fims.framework.support.util.AjaxMessageMapRenderer; -import cokr.xit.fims.framework.support.util.Checks; -import cokr.xit.fims.framework.support.util.ValidationError; -import cokr.xit.fims.framework.support.util.constants.MessageKey; -import lombok.RequiredArgsConstructor; -import org.springframework.stereotype.Controller; -import org.springframework.validation.BindingResult; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -import javax.servlet.http.HttpServletRequest; -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.util.List; -import java.util.Map; - -@RequiredArgsConstructor -@Controller -@RequestMapping(name = "", value = "/framework/biz/mng/code") -public class ZipCodeMgtController extends AbstractController { - private final ZipCodeMgtService service; - - - @RequestMapping(name = "", value = "/mngZipCodeMgtPopup") - public ModelAndView mngZipCodeMgtPopup(final XitZipCodeMngVO vo) { - ModelAndView mav = new ModelAndView(); - - mav.addObject("zipVO", Checks.isEmpty(vo.getZip())? new XitZipCodeMngVO(): service.findZipCode(vo)); - mav.addObject("pageTitle", "우편번호 등록 / 변경"); - mav.setViewName(FrameworkConstants.FRAMEWORK_JSP_BASE_PATH + "mng/code/mngZipCodeMgtPopup.popup"); - return mav; - } - - @RequestMapping(name = "", value = "/mngZipCodeByExcelPopup") - public ModelAndView mngZipCodeByExcelPopup() { - ModelAndView mav = new ModelAndView(); - - mav.addObject("pageTitle", "우편번호 Excel 파일 업로드"); - mav.setViewName(FrameworkConstants.FRAMEWORK_JSP_BASE_PATH + "mng/code/mngZipCodeByExcelPopup.popup"); - return mav; - } - - @GetMapping(name = "", value = "/findZipCodes") - public ModelAndView findZipCodes(@RequestParam final Map paraMap){ - return ResultResponse.of(service.findZipCodes(paraMap, MybatisUtils.getPagingInfo(paraMap))); - } - - @GetMapping(name = "", value = "/findZipCode") - public ModelAndView findZipCode(final XitZipCodeMngVO vo){ - return ResultResponse.of(service.findZipCode(vo)); - } - - @PostMapping(name = "", value = "/addZipCode") - public ModelAndView addZipCode(final XitZipCodeMngVO vo, final BindingResult bindingResult){ - ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW); - - ValidationError.of("zipVO", vo, bindingResult); - service.addZipCode(vo); - AjaxMessageMapRenderer.success(mav, MessageKey.CMM_INSERT_SUCCESS); - return mav; - } - - @PostMapping(name = "", value = "/modifyZipCode") - public ModelAndView modifyZipCode(final XitZipCodeMngVO vo, final BindingResult bindingResult){ - ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW); - - ValidationError.of("zipVO", vo, bindingResult); - service.modifyZipCode(vo); - AjaxMessageMapRenderer.success(mav, MessageKey.CMM_UPDATE_SUCCESS); - return mav; - } - - @PostMapping(name = "", value = "/removeZipCode") - public ModelAndView removeZipCode(final XitZipCodeMngVO vo){ - ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW); - - service.removeZipcode(vo); - AjaxMessageMapRenderer.success(mav, MessageKey.CMM_DELETE_SUCCESS); - return mav; - } - - @PostMapping(name = "", value = "/uploadZipCodeByExcel", consumes = {"multipart/form-data"}) - //public String uploadZipCodeByExcel(MultipartHttpServletRequest request) { - public ModelAndView uploadZipCodeByExcel(HttpServletRequest request) { - ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW); - - //service.uploadZipCodeByExcel() - - List< XitAttachFileVO> listAttchFile = XitAttachFileUtil.fileUpload(request, XitCmmnUtil.setOsPath("/home/tempUpload"), true, 5); - - XitAttachFileVO fileVO = listAttchFile.get(0); - if(Checks.isEmpty(fileVO.getFileName())) throw BizRuntimeException.create(MessageKey.CUSTOM_MSG, "업로드할 엑셀파일이 없습니다."); - if (!(fileVO.getFileName().toLowerCase().endsWith(".xls") - || fileVO.getFileName().toLowerCase().endsWith(".xlsx"))) throw BizRuntimeException.create(MessageKey.CUSTOM_MSG, "업로드할 엑셀파일이 없습니다."); - - File file = new File(fileVO.getFileFullPath()); - try(FileInputStream fis = new FileInputStream(file)) { - service.uploadZipCodeByExcel(fis); - }catch(IOException ie){ - throw BizRuntimeException.create(MessageKey.CUSTOM_MSG, ie.getMessage()); - } - - - - AjaxMessageMapRenderer.success(mav, MessageKey.CMM_SUCCESS); - return mav; - - } -} - diff --git a/src/main/java/cokr/xit/fims/framework/biz/mng/menu/service/bean/MenuMgtServiceBean.java b/src/main/java/cokr/xit/fims/framework/biz/mng/menu/service/bean/MenuMgtServiceBean.java index b7c82112..da06bf6c 100644 --- a/src/main/java/cokr/xit/fims/framework/biz/mng/menu/service/bean/MenuMgtServiceBean.java +++ b/src/main/java/cokr/xit/fims/framework/biz/mng/menu/service/bean/MenuMgtServiceBean.java @@ -20,8 +20,6 @@ import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Workbook; -import org.egovframe.rte.fdl.excel.EgovExcelService; -import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -37,8 +35,8 @@ public class MenuMgtServiceBean extends AbstractServiceBean implements MenuMgtSe private final MenuMgtMapper mapper; private final ProgramMgtMapper programMngMapper; private final CacheService cacheService; - @Qualifier("egovExcelService") - private final EgovExcelService egovExcelService; + + @Override @Transactional(readOnly = true) @@ -245,7 +243,7 @@ public class MenuMgtServiceBean extends AbstractServiceBean implements MenuMgtSe if (XitCmmnUtil.notEmpty(listMenuInfoVO) && listMenuInfoVO.size() > 1) { return requestValue = "99"; } //메뉴정보테이블 데이타 존재오류. - Workbook hssfWB = egovExcelService.loadWorkbook(inputStream); + Workbook hssfWB = null; //log.debug("hssfWB:::::"+hssfWB); // 엑셀 파일 시트 갯수 확인 sheet = 2 첫번째시트 = 프로그램목록 두번째시트 = 메뉴목록 if (hssfWB.getNumberOfSheets() == 2) { diff --git a/src/main/java/cokr/xit/fims/framework/biz/mng/menu/web/MenuByRoleMgtController.java b/src/main/java/cokr/xit/fims/framework/biz/mng/menu/web/MenuByRoleMgtController.java index 07e26e95..9233ec44 100644 --- a/src/main/java/cokr/xit/fims/framework/biz/mng/menu/web/MenuByRoleMgtController.java +++ b/src/main/java/cokr/xit/fims/framework/biz/mng/menu/web/MenuByRoleMgtController.java @@ -4,7 +4,7 @@ import cokr.xit.foundation.web.AbstractController; import cokr.xit.fims.framework.biz.mng.menu.MenuCreateMngVO; import cokr.xit.fims.framework.biz.mng.menu.service.MenuByRoleMgtService; import cokr.xit.fims.framework.core.constants.FrameworkConstants; -import cokr.xit.fims.framework.core.ResultResponse; + import cokr.xit.fims.framework.support.util.AjaxMessageMapRenderer; import cokr.xit.fims.framework.support.util.constants.MessageKey; import lombok.RequiredArgsConstructor; @@ -36,7 +36,7 @@ public class MenuByRoleMgtController extends AbstractController { @GetMapping(name = "", value = "/findMenuByRoleList") public ModelAndView findMenus(@RequestParam final Map paraMap) { - return ResultResponse.of(service.findRoleInfos(paraMap)); + return new ModelAndView("jsonView").addObject("result",service.findRoleInfos(paraMap)); } @PostMapping(name = "", value = "/saveMenuByRoleList") diff --git a/src/main/java/cokr/xit/fims/framework/biz/mng/menu/web/MenuMgtController.java b/src/main/java/cokr/xit/fims/framework/biz/mng/menu/web/MenuMgtController.java index 62d979e4..d66f18ed 100644 --- a/src/main/java/cokr/xit/fims/framework/biz/mng/menu/web/MenuMgtController.java +++ b/src/main/java/cokr/xit/fims/framework/biz/mng/menu/web/MenuMgtController.java @@ -4,7 +4,7 @@ import cokr.xit.foundation.web.AbstractController; import cokr.xit.fims.framework.biz.mng.menu.XitMenuInfoVO; import cokr.xit.fims.framework.biz.mng.menu.service.MenuMgtService; import cokr.xit.fims.framework.core.constants.FrameworkConstants; -import cokr.xit.fims.framework.core.ResultResponse; + import cokr.xit.fims.framework.core.utils.XitCmmnUtil; import cokr.xit.fims.framework.core.utils.attachfile.XitAttachFileUtil; import cokr.xit.fims.framework.core.utils.attachfile.XitAttachFileVO; @@ -76,7 +76,7 @@ public class MenuMgtController extends AbstractController { @GetMapping(name = "", value = "/findMenus") public ModelAndView findMenus(@RequestParam final Map paraMap) { - return ResultResponse.of(service.findMenus(paraMap, MybatisUtils.getPagingInfo(paraMap))); + return new ModelAndView("jsonView").addObject("result",service.findMenus(paraMap, MybatisUtils.getPagingInfo(paraMap))); } @PostMapping(name = "", value = "/addMenu") diff --git a/src/main/java/cokr/xit/fims/framework/biz/mng/menu/web/ProgramMgtController.java b/src/main/java/cokr/xit/fims/framework/biz/mng/menu/web/ProgramMgtController.java index 35692834..824829d0 100644 --- a/src/main/java/cokr/xit/fims/framework/biz/mng/menu/web/ProgramMgtController.java +++ b/src/main/java/cokr/xit/fims/framework/biz/mng/menu/web/ProgramMgtController.java @@ -4,7 +4,7 @@ import cokr.xit.foundation.web.AbstractController; import cokr.xit.fims.framework.biz.mng.menu.ProgramMngVO; import cokr.xit.fims.framework.biz.mng.menu.service.ProgramMgtService; import cokr.xit.fims.framework.core.constants.FrameworkConstants; -import cokr.xit.fims.framework.core.ResultResponse; + import cokr.xit.fims.framework.support.mybatis.MybatisUtils; import cokr.xit.fims.framework.support.util.AjaxMessageMapRenderer; import cokr.xit.fims.framework.support.util.Checks; @@ -79,7 +79,7 @@ public class ProgramMgtController extends AbstractController { /*@PostMapping(name = "", value = "ProgramMng_list.ajax")*/ @GetMapping(name = "", value = "/findPrograms") public ModelAndView findPrograms(@RequestParam final Map paraMap) { - return ResultResponse.of(service.findPrograms(paraMap, MybatisUtils.getPagingInfo(paraMap))); + return new ModelAndView("jsonView").addObject("result",service.findPrograms(paraMap, MybatisUtils.getPagingInfo(paraMap))); } /** diff --git a/src/main/java/cokr/xit/fims/framework/biz/mng/user/web/UserMgtController.java b/src/main/java/cokr/xit/fims/framework/biz/mng/user/web/UserMgtController.java index 543b965a..246fd267 100644 --- a/src/main/java/cokr/xit/fims/framework/biz/mng/user/web/UserMgtController.java +++ b/src/main/java/cokr/xit/fims/framework/biz/mng/user/web/UserMgtController.java @@ -7,7 +7,7 @@ import cokr.xit.fims.framework.biz.mng.user.XitUserRegMngVO; import cokr.xit.fims.framework.biz.mng.user.service.UserMgtService; import cokr.xit.fims.framework.core.constants.FrameworkConstants; import cokr.xit.fims.framework.core.constants.FrameworkConstants.TILES_TYPE; -import cokr.xit.fims.framework.core.ResultResponse; + import cokr.xit.fims.framework.core.utils.XitCmmnUtil; import cokr.xit.fims.framework.support.mybatis.MybatisUtils; import cokr.xit.fims.framework.support.util.AjaxMessageMapRenderer; @@ -84,7 +84,7 @@ public class UserMgtController extends AbstractController { */ @GetMapping(name = "", value = "/findUsers") public ModelAndView findUsers(@RequestParam final Map paraMap) { - return ResultResponse.of(service.findUsers(paraMap, MybatisUtils.getPagingInfo(paraMap))); + return new ModelAndView("jsonView").addObject("result",service.findUsers(paraMap, MybatisUtils.getPagingInfo(paraMap))); } diff --git a/src/main/java/cokr/xit/fims/framework/core/ResultResponse.java b/src/main/java/cokr/xit/fims/framework/core/ResultResponse.java deleted file mode 100644 index 9eb84bd0..00000000 --- a/src/main/java/cokr/xit/fims/framework/core/ResultResponse.java +++ /dev/null @@ -1,189 +0,0 @@ -package cokr.xit.fims.framework.core; - -//import com.fasterxml.jackson.dataformat.xml.XmlMapper; -//import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; - -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; -import com.google.gson.GsonBuilder; -import cokr.xit.fims.framework.core.constants.FrameworkConstants; -import cokr.xit.fims.framework.core.utils.json.ConvertHelper; -import lombok.Getter; -import lombok.Setter; -import org.springframework.web.servlet.ModelAndView; - -import java.io.Serializable; -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; - -@Getter @Setter -@JacksonXmlRootElement(localName = "result") -@SuppressWarnings("rawtypes") -public class ResultResponse implements IResponse, Serializable { - private static final long SerialVersionUID = 1L; - - private final static String SUCCESS = "200"; - private final static String NOT_FOUND = "400"; - private final static String FAILED = "500"; - private final static String SUCCESS_MESSAGE = "정상 처리 되었습니다."; - private final static String NOT_FOUND_MESSAGE = "NOT FOUND"; - private final static String FAILED_MESSAGE = "서버에서 오류가 발생하였습니다."; - - //private boolean success = true; - - //private int count; - - //private ResultMessage message; - - //private T data; - - //private Paginator paginator; - - //private ModelAndView mav; - - private ResultResponse() { - - } - - private ResultResponse(T data) { - ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW); - mav.addObject("result", true); - mav.addObject("message", SUCCESS_MESSAGE); - mav.addObject("data", data); - - if(data == null){ - mav.addObject("count", 0); - - }else { - // Pageing 처리 - - if (Collection.class.isAssignableFrom(data.getClass())) { - mav.addObject("count", (((Collection) data).size())); - - } else { - mav.addObject("count", 1); - } - } - } - - /** - *
-     * return ModelAndView (Grid data)
-     *  {
-     *   result - true / false
-     *   message
-     *   data: {
-     *    contents - 실행결과 데이타
-     *    pagination - 페이징 요청 처리시
-     *   }
-     *   count - 목록의 수(페이징 요청 처리시는 현재 페이지 목록수)
-     *  }
-     * 
- * @param data - * @return - * @param - */ - public static ModelAndView of(T data){ - ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW); - - mav.addObject("result", true); - mav.addObject("message", SUCCESS_MESSAGE); - - Map map = new HashMap<>(); - map.put("contents", data); - mav.addObject("data", map); - - if(data == null){ - mav.addObject("count", 0); - - }else { - // Pageing 처리 - - if (Collection.class.isAssignableFrom(data.getClass())) { - mav.addObject("count", (((Collection) data).size())); - - } else { - mav.addObject("count", 1); - } - } - return mav; - } - - public static ModelAndView of(T data, String viewName){ - ModelAndView mav = new ModelAndView(viewName); - - mav.addObject("result", true); - mav.addObject("message", SUCCESS_MESSAGE); - - Map map = new HashMap<>(); - map.put("contents", data); - mav.addObject("data", map); - - if(data == null){ - mav.addObject("count", 0); - - }else { - // Pageing 처리 - - if (Collection.class.isAssignableFrom(data.getClass())) { - mav.addObject("count", (((Collection) data).size())); - - } else { - mav.addObject("count", 1); - } - } - return mav; - } - - public static ModelAndView of(String attName, T data){ - ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW); - - mav.addObject("result", true); - mav.addObject("message", SUCCESS_MESSAGE); - mav.addObject(attName, data); - - if(data == null){ - mav.addObject("count", 0); - - }else { - // Pageing 처리 - - if (Collection.class.isAssignableFrom(data.getClass())) { - mav.addObject("count", (((Collection) data).size())); - - } else { - mav.addObject("count", 1); - } - } - return mav; - } - - @Override - public String toString() { - GsonBuilder builder = new GsonBuilder().serializeNulls(); // value가 null값인 경우도 생성 - builder.disableHtmlEscaping(); - return builder.setPrettyPrinting().create().toJson(this); - } - - public String convertToJson() { - return ConvertHelper.jsonToObject(this); - } - - public String asToString(ResultResponse t) { - GsonBuilder builder = new GsonBuilder().serializeNulls(); // value가 null값인 경우도 생성 - builder.disableHtmlEscaping(); - return builder.setPrettyPrinting().create().toJson(t); - } - - // public Map toMap(ObjectMapper mapper){ - // if(mapper == null) mapper = JsonMapper.getMapper(); - // - // if(mapper instanceof XmlMapper){ - // Map xmlMap = new HashMap<>(); - // xmlMap.put("result", this); - // return xmlMap; - // } - // - // return mapper.convertValue(this, Map.class); - // } -} diff --git a/src/main/java/cokr/xit/fims/framework/core/ResultResponse2.java b/src/main/java/cokr/xit/fims/framework/core/ResultResponse2.java deleted file mode 100644 index 58e8b070..00000000 --- a/src/main/java/cokr/xit/fims/framework/core/ResultResponse2.java +++ /dev/null @@ -1,107 +0,0 @@ -package cokr.xit.fims.framework.core; - -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; -import com.google.gson.GsonBuilder; -import cokr.xit.fims.framework.core.utils.json.ConvertHelper; -import cokr.xit.fims.framework.support.mybatis.paging.domain.Paginator; -import lombok.Getter; -import lombok.Setter; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; - -import java.io.Serializable; -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; - -@Getter @Setter -@JacksonXmlRootElement(localName = "result") -@SuppressWarnings("rawtypes") -public class ResultResponse2 implements IResponse, Serializable { - private static final long SerialVersionUID = 1L; - - private final static String SUCCESS = "200"; - private final static String NOT_FOUND = "400"; - private final static String FAILED = "500"; - private final static String SUCCESS_MESSAGE = "SUCCESS"; - private final static String NOT_FOUND_MESSAGE = "NOT FOUND"; - private final static String FAILED_MESSAGE = "서버에서 오류가 발생하였습니다."; - - private boolean success = true; - - private int count; - - private ResultMessage message; - - private T data; - - private Paginator paginator; - - private ResultResponse2() { - - } - - private ResultResponse2(T data) { - this.message = new ResultMessage(SUCCESS, SUCCESS_MESSAGE); - this.data = data; - - if(data == null){ - this.count = 0; - - }else { - // Pageing 처리 - - if (Collection.class.isAssignableFrom(data.getClass())) { - this.count = (((Collection) data).size()); - - } else { - this.count = 1; - } - } - } - - public static ResponseEntity of(T data){ - return ResponseEntity.ok().body(new ResultResponse2<>(data)); - } - - public static ResponseEntity of(String name, T data){ - Map map = new HashMap<>(); - map.put(name, data); - return ResponseEntity.ok().body(new ResultResponse2<>(map)); - } - - public static ResponseEntity of(HttpStatus httpStatus){ - ResultResponse2 result = new ResultResponse2(); - result.message = new ResultMessage(SUCCESS, SUCCESS_MESSAGE); - return new ResponseEntity<>(result, httpStatus); - } - - @Override - public String toString() { - GsonBuilder builder = new GsonBuilder().serializeNulls(); // value가 null값인 경우도 생성 - builder.disableHtmlEscaping(); - return builder.setPrettyPrinting().create().toJson(this); - } - - public String convertToJson() { - return ConvertHelper.jsonToObject(this); - } - - public String asToString(ResultResponse2 t) { - GsonBuilder builder = new GsonBuilder().serializeNulls(); // value가 null값인 경우도 생성 - builder.disableHtmlEscaping(); - return builder.setPrettyPrinting().create().toJson(t); - } - - // public Map toMap(ObjectMapper mapper){ - // if(mapper == null) mapper = JsonMapper.getMapper(); - // - // if(mapper instanceof XmlMapper){ - // Map xmlMap = new HashMap<>(); - // xmlMap.put("result", this); - // return xmlMap; - // } - // - // return mapper.convertValue(this, Map.class); - // } -} diff --git a/src/main/java/cokr/xit/fims/framework/core/XitRollingNotiVO.java b/src/main/java/cokr/xit/fims/framework/core/XitRollingNotiVO.java deleted file mode 100644 index 2fe4fb4b..00000000 --- a/src/main/java/cokr/xit/fims/framework/core/XitRollingNotiVO.java +++ /dev/null @@ -1,31 +0,0 @@ -package cokr.xit.fims.framework.core; - -import cokr.xit.fims.framework.biz.cmm.XitBbsVO; -import lombok.*; - -import java.util.List; - -/** - * - * @업무그룹명: 롤링 공지사항 VO - * @설명: 불필요한 메모리 할당을 지양하기 위해 Singletone 패턴을 이용하여 생성된 객체로 공지사항 목록을 제공 한다. - * @최초작성일: 2020. 10. 13. 오후 2:21:53 - * @최초작성자: 박민규 - * @author (주)엑스아이티 개발팀 - * @since 2002. 2. 2. - * @version 1.0 Copyright(c) XIT All rights reserved. - */ -@Setter -@Getter -@AllArgsConstructor -@NoArgsConstructor -@EqualsAndHashCode -@ToString -public class XitRollingNotiVO { - - private List list; //게시글 목록 - private String bbsId; //게시판 id - private String parntsSntncNo; //부모 글 번호 - private String useYn; //사용 여부 - -} diff --git a/src/main/java/cokr/xit/fims/framework/core/aop/LogAopAdvice.java b/src/main/java/cokr/xit/fims/framework/core/aop/LogAopAdvice.java index 55024de7..58b5eb1c 100644 --- a/src/main/java/cokr/xit/fims/framework/core/aop/LogAopAdvice.java +++ b/src/main/java/cokr/xit/fims/framework/core/aop/LogAopAdvice.java @@ -28,8 +28,8 @@ import java.util.Map; @Aspect public class LogAopAdvice { - @Value("#{prop['debug.result.log.trace']}") - private boolean isRsltLog; + + private boolean isRsltLog = true; @Pointcut("execution(public * cokr.xit..web.*.*(..))") public void pointCut() {} diff --git a/src/main/java/cokr/xit/fims/framework/core/config/Swagger2Config.java b/src/main/java/cokr/xit/fims/framework/core/config/Swagger2Config.java deleted file mode 100644 index 29454b63..00000000 --- a/src/main/java/cokr/xit/fims/framework/core/config/Swagger2Config.java +++ /dev/null @@ -1,146 +0,0 @@ -package cokr.xit.fims.framework.core.config; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.web.servlet.config.annotation.EnableWebMvc; -import springfox.documentation.builders.ApiInfoBuilder; -import springfox.documentation.builders.PathSelectors; -import springfox.documentation.builders.RequestHandlerSelectors; -import springfox.documentation.builders.ResponseMessageBuilder; -import springfox.documentation.service.*; -import springfox.documentation.spi.DocumentationType; -import springfox.documentation.spi.service.contexts.SecurityContext; -import springfox.documentation.spring.web.plugins.Docket; -import springfox.documentation.swagger.web.*; -import springfox.documentation.swagger2.annotations.EnableSwagger2; - -import java.util.*; - -@Configuration -@EnableSwagger2 -//@EnableSwagger2WebMvc -@EnableWebMvc -public class Swagger2Config { - - @Bean - public Docket newsApiAll() { - return new Docket(DocumentationType.SWAGGER_2) - .consumes(getConsumeContentTypes()) - //.produces(getProduceContentTypes()) - .groupName("01. FIMS Biz API REST Service") - .select() - .apis(RequestHandlerSelectors.basePackage("cokr.xit.fims.biz")) - .paths(PathSelectors.ant("/fims/biz/**")) - .build() - .apiInfo(apiInfo()) - //.globalResponseMessage(RequestMethod.GET, getResMessages()) - //.securityContexts(Arrays.asList(securityContext())) - //.securitySchemes(Arrays.asList(apiKey())) - ; - } - - @Bean - public Docket newsApiAccelerator() { - return new Docket(DocumentationType.SWAGGER_2) - .groupName("02. Framework Biz API REST Service") - .consumes(getConsumeContentTypes()) - //.produces(getProduceContentTypes()) - .select() - .apis(RequestHandlerSelectors.basePackage("cokr.xit.fims.framework.biz")) - .paths(PathSelectors.ant("/framework/biz/**")) - .build() - .apiInfo(apiInfo()) - //.globalResponseMessage(RequestMethod.GET, getResMessages()) - //.securityContexts(Arrays.asList(securityContext())) - //.securitySchemes(Arrays.asList(apiKey())) - ; - } - - @Bean - public UiConfiguration uiConfig() { - return UiConfigurationBuilder.builder() - .deepLinking(false) - .displayOperationId(false) - .defaultModelsExpandDepth(-1) - .defaultModelExpandDepth(1) - .defaultModelRendering(ModelRendering.EXAMPLE) - .displayRequestDuration(false) - .docExpansion(DocExpansion.NONE) - .filter(false) - .maxDisplayedTags(null) - .operationsSorter(OperationsSorter.METHOD) - .showExtensions(false) - .tagsSorter(TagsSorter.ALPHA) - .supportedSubmitMethods(UiConfiguration.Constants.DEFAULT_SUBMIT_METHODS) - .validatorUrl(null) - .build(); - } - - private ApiInfo apiInfo() { - return new ApiInfoBuilder() - .title("통합플랫폼 Rest API Documentation") - .description("통합플랫폼 Rest api 서비스") - .termsOfServiceUrl("https://www.egovframe.go.kr/wiki/doku.php?id=egovframework:hyb:gate_page") - .license("Apache License Version 2.0") - .licenseUrl("https://www.egovframe.go.kr") - .version("0.1") - .build(); - } - - private List getResMessages() { - List responseMessages = new ArrayList<>(); - responseMessages.add(new ResponseMessageBuilder() - .code(200) - .message("OK") - .build()); - responseMessages.add(new ResponseMessageBuilder() - .code(401) - .message("Unauthorized") - .build()); - responseMessages.add(new ResponseMessageBuilder() - .code(403) - .message("Forbidden") - .build()); - responseMessages.add(new ResponseMessageBuilder() - .code(404) - .message("Not Found") - .build()); - responseMessages.add(new ResponseMessageBuilder() - .code(500) - .message("Internal Server Error") - .build()); - - return responseMessages; - } - - private Set getConsumeContentTypes() { - Set consumes = new HashSet<>(); - consumes.add("application/x-www-form-urlencoded"); - consumes.add("application/json;charset=UTF-8"); - return consumes; - } - - private Set getProduceContentTypes() { - Set produces = new HashSet<>(); - produces.add("application/json;charset=UTF-8"); - return produces; - } - - //ApiKey 정의 - private ApiKey apiKey() { - //return new ApiKey("JWT", "Authorization", "header"); - return new ApiKey("Authorization", "Authorization", "header"); - } - - //JWT SecurityContext 구성 - private SecurityContext securityContext() { - return SecurityContext.builder().securityReferences(defaultAuth()).build(); - } - - private List defaultAuth() { - AuthorizationScope authorizationScope = new AuthorizationScope("global", "accessEveryThing"); - AuthorizationScope[] authorizationScopes = new AuthorizationScope[1]; - authorizationScopes[0] = authorizationScope; - return Arrays.asList(new SecurityReference("Authorization", authorizationScopes)); - } -} diff --git a/src/main/java/cokr/xit/fims/framework/core/config/ThymeleafViewResolverConfig.java b/src/main/java/cokr/xit/fims/framework/core/config/ThymeleafViewResolverConfig.java deleted file mode 100644 index 41a37933..00000000 --- a/src/main/java/cokr/xit/fims/framework/core/config/ThymeleafViewResolverConfig.java +++ /dev/null @@ -1,57 +0,0 @@ -package cokr.xit.fims.framework.core.config; - -import nz.net.ultraq.thymeleaf.layoutdialect.LayoutDialect; -import nz.net.ultraq.thymeleaf.layoutdialect.decorators.strategies.GroupingStrategy; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.MessageSource; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.web.servlet.ViewResolver; -import org.thymeleaf.spring5.SpringTemplateEngine; -import org.thymeleaf.spring5.templateresolver.SpringResourceTemplateResolver; -import org.thymeleaf.spring5.view.ThymeleafViewResolver; - -@Configuration -public class ThymeleafViewResolverConfig { - - @Bean - public SpringResourceTemplateResolver templateResolver() { - SpringResourceTemplateResolver templateResolver = new SpringResourceTemplateResolver(); - //templateResolver.setPrefix("classpath:/templates"); - - templateResolver.setPrefix("/WEB-INF/templates/thymeleaf"); - templateResolver.setSuffix(".html"); - - templateResolver.setCharacterEncoding("UTF-8"); - templateResolver.setTemplateMode("HTML5"); - templateResolver.setCacheable(false); - - return templateResolver; - } - - @Bean - public SpringTemplateEngine templateEngine(MessageSource messageSource) { - SpringTemplateEngine templateEngine = new SpringTemplateEngine(); - templateEngine.setTemplateResolver(templateResolver()); - templateEngine.setTemplateEngineMessageSource(messageSource); - templateEngine.addDialect(layoutDialect()); - return templateEngine; - } - - @Bean - public LayoutDialect layoutDialect() { - return new LayoutDialect(new GroupingStrategy()); - } - - @Bean - @Autowired - public ViewResolver viewResolver(MessageSource messageSource) { - ThymeleafViewResolver viewResolver = new ThymeleafViewResolver(); - viewResolver.setTemplateEngine(templateEngine(messageSource)); - viewResolver.setCharacterEncoding("UTF-8"); - String[] viewNames = {"thymeleaf"}; - viewResolver.setViewNames(viewNames); - viewResolver.setOrder(1); - return viewResolver; - } -} diff --git a/src/main/java/cokr/xit/fims/framework/core/config/ignore/CacheConfig3.java b/src/main/java/cokr/xit/fims/framework/core/config/ignore/CacheConfig3.java deleted file mode 100644 index cb39490a..00000000 --- a/src/main/java/cokr/xit/fims/framework/core/config/ignore/CacheConfig3.java +++ /dev/null @@ -1,34 +0,0 @@ -package cokr.xit.fims.framework.core.config.ignore; - -import org.springframework.cache.CacheManager; -import org.springframework.cache.jcache.JCacheCacheManager; -import org.springframework.cache.jcache.JCacheManagerFactoryBean; -import org.springframework.context.annotation.Bean; - -import java.net.URISyntaxException; -import java.net.URL; - -/** - * spring version 과의 호환성 문제로 2.X 대 버전 사용 - */ -@Deprecated -//@Configuration -//@EnableCaching -public class CacheConfig3 { - - @Bean - public CacheManager cacheManager() throws URISyntaxException { - return - new JCacheCacheManager();//ehCacheManager().getObject()); - } - - @Bean - public JCacheManagerFactoryBean ehCacheManager() throws URISyntaxException { - - final URL confUrl = getClass().getResource("/spring/service/cache/ehcache3.xml"); - JCacheManagerFactoryBean cmfb = new JCacheManagerFactoryBean(); - cmfb.setCacheManagerUri(confUrl.toURI()); - //cmfb.setConfigLocation(new ClassPathResource("classpath:/spring/service/cache/ehcache3.xml")); - return cmfb; - } -} diff --git a/src/main/java/cokr/xit/fims/framework/core/config/ignore/JasyptConfig.java b/src/main/java/cokr/xit/fims/framework/core/config/ignore/JasyptConfig.java deleted file mode 100644 index 6956a8a9..00000000 --- a/src/main/java/cokr/xit/fims/framework/core/config/ignore/JasyptConfig.java +++ /dev/null @@ -1,50 +0,0 @@ -package cokr.xit.fims.framework.core.config.ignore; - -import org.jasypt.encryption.StringEncryptor; -import org.jasypt.encryption.pbe.PooledPBEStringEncryptor; -import org.jasypt.encryption.pbe.StandardPBEStringEncryptor; -import org.jasypt.encryption.pbe.config.SimpleStringPBEConfig; -import org.springframework.context.annotation.Bean; - -/** - * context-properties.xml 설정 사용 - * 암호화 필요한 데이타 값 check 필요시 사용 - */ -@Deprecated -//@Configuration -public class JasyptConfig { - - @Bean(name = "jasyptStringEncryptor") - public StringEncryptor stringEncryptor() { - final String key = "xit5811807!@"; - PooledPBEStringEncryptor encryptor = new PooledPBEStringEncryptor(); - SimpleStringPBEConfig config = new SimpleStringPBEConfig(); - config.setPassword(key); - config.setAlgorithm("PBEWithMD5AndDES"); - config.setPoolSize("1"); - encryptor.setConfig(config); - return encryptor; - } - - //FIXME : 설정의 암호화 필요시 - public static void main(String[] args) { - StandardPBEStringEncryptor encryptor = new StandardPBEStringEncryptor(); - encryptor.setAlgorithm("PBEWithMD5AndDES"); - encryptor.setPassword("fimsweb!@"); - String url = encryptor.encrypt("jdbc:log4jdbc:mariadb://211.119.124.9:4407/fims?useUnicode=true&characterEncoding=utf8serverTimezone=Asia/Seoul&useSSL=false"); - String id = encryptor.encrypt("fimsweb"); - String passwd = encryptor.encrypt("fimsweb"); - String passwd2 = encryptor.encrypt("fimsweb!@"); - String decryptedPass = encryptor.decrypt(url); - System.out.println(url); - System.out.println(id); - System.out.println(passwd); - System.out.println(passwd2); - System.out.println(decryptedPass); - - } - -} - - - diff --git a/src/main/java/cokr/xit/fims/framework/core/filter/XitCorsFilter.java b/src/main/java/cokr/xit/fims/framework/core/filter/XitCorsFilter.java deleted file mode 100644 index 23f3dffb..00000000 --- a/src/main/java/cokr/xit/fims/framework/core/filter/XitCorsFilter.java +++ /dev/null @@ -1,70 +0,0 @@ -package cokr.xit.fims.framework.core.filter; - -import org.springframework.web.filter.OncePerRequestFilter; - -import javax.servlet.FilterChain; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; - -/** - * - * @업무그룹명: CORS(Cross-Origin Resource Sharing) Filter - * @설명: 2009년에 등장한 "교차 출처 자원 공유" 정책. - * 대체적으로 프로토콜, 도메인, 포트가 일치해야 동일출처로 인정 된다(SOP). - * SOP는 동일출처에서만 자원공유가 가능한 정책으로 다른 출처에서 자원요청시 에러가 발생한다. 이에 대한 예외 조항이 CORS 정책 이다. - * SOP 정책에는 다른 출처의 리소스에 접근 할 수 있는 CORS 외에도 몇가지 예외조항이 있는데 실행 가능한 스크립트, 렌더될 이미지, 스타일 시트(css)정도가 있다. - * @최초작성일: 2020. 11. 13. 오후 5:10:57 - * @최초작성자: 박민규 - * @author (주)엑스아이티 개발팀 - * @since 2002. 2. 2. - * @version 1.0 Copyright(c) XIT All rights reserved. - */ -public class XitCorsFilter extends OncePerRequestFilter{ - - - /** 접근 허용 출처 */ - private String accessControlAllowOrigin; //ex> * OR www.xerotech.co.kr OR www.xerotech.co.kr, www.naver.com 등... 단, Access-Control-Allow-Credentials: true 설정 시 * 은 사용 불가 - /** 접근 허용 Method */ - private String accessControlAllowMethods; //ex> GET, POST, HEAD, PUT, PATCH, DELETE 등.. - /** */ - private String accessControlAllowHeaders; //ex> x-requested-with (비표준 ajax 요청 헤더) - /** Preflight Request의 결과가 캐쉬에 남아있는 시간(단위: 초(second)) */ - private String accessControlMaxAge; //ex> 3600 (1시간) - - - @Override - protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) - throws ServletException, IOException { - if(!( this.accessControlAllowOrigin==null || "".equals(this.accessControlAllowOrigin) )) - response.addHeader("Access-Control-Allow-Origin", this.accessControlAllowOrigin); - - if(!( this.accessControlAllowMethods==null || "".equals(this.accessControlAllowMethods) )) - response.addHeader("Access-Control-Allow-Methods", this.accessControlAllowMethods); - - if(!( this.accessControlAllowHeaders==null || "".equals(this.accessControlAllowHeaders) )) - response.addHeader("Access-Control-Allow-Headers", this.accessControlAllowHeaders); - - if(!( this.accessControlMaxAge==null || "".equals(this.accessControlMaxAge) )) - response.addHeader("Access-Control-Max-Age", this.accessControlMaxAge); - - filterChain.doFilter(request, response); - - } - - - public void setAccessControlAllowOrigin(String accessControlAllowOrigin) { - this.accessControlAllowOrigin = accessControlAllowOrigin; - } - public void setAccessControlAllowMethods(String accessControlAllowMethods) { - this.accessControlAllowMethods = accessControlAllowMethods; - } - public void setAccessControlAllowHeaders(String accessControlAllowHeaders) { - this.accessControlAllowHeaders = accessControlAllowHeaders; - } - public void setAccessControlMaxAge(String accessControlMaxAge) { - this.accessControlMaxAge = accessControlMaxAge; - } - -} diff --git a/src/main/java/cokr/xit/fims/framework/core/filter/log/ReadableRequestWrapperFilter.java b/src/main/java/cokr/xit/fims/framework/core/filter/log/ReadableRequestWrapperFilter.java deleted file mode 100644 index e7ed2d0f..00000000 --- a/src/main/java/cokr/xit/fims/framework/core/filter/log/ReadableRequestWrapperFilter.java +++ /dev/null @@ -1,169 +0,0 @@ -package cokr.xit.fims.framework.core.filter.log; - -import cokr.xit.fims.framework.support.util.Checks; -import lombok.extern.slf4j.Slf4j; -import org.apache.commons.io.IOUtils; -import org.json.simple.JSONArray; -import org.json.simple.JSONObject; -import org.json.simple.parser.JSONParser; -import org.springframework.http.MediaType; -import org.springframework.util.StringUtils; - -import javax.servlet.*; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletRequestWrapper; -import java.io.*; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; -import java.util.*; -import java.util.stream.Collectors; - -/** - * Post parameter log를 보려면 활설화 해야 함 - */ -@Slf4j -//@WebFilter(urlPatterns = "/api/*") -//@Order(Ordered.HIGHEST_PRECEDENCE) -public class ReadableRequestWrapperFilter implements Filter { - @Override - public void init(FilterConfig filterConfig) { - // Do nothing - } - - @Override - public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) - throws IOException, ServletException { - - // Multipart skip - //if(!Objects.equals(request.getContentType(), MediaType.MULTIPART_FORM_DATA_VALUE)) { - ReadableRequestWrapper wrapper = new ReadableRequestWrapper((HttpServletRequest) request); - chain.doFilter(wrapper, response); - //}else{ - // chain.doFilter(request, response); - //} - } - - @Override - public void destroy() { - // Do nothing - } - - public static class ReadableRequestWrapper extends HttpServletRequestWrapper { - private final Charset encoding; - private byte[] rawData; - private Map params = new HashMap<>(); - - public ReadableRequestWrapper(HttpServletRequest request) { - super(request); - this.params.putAll(request.getParameterMap()); // 원래의 파라미터를 저장 - - String charEncoding = request.getCharacterEncoding(); // 인코딩 설정 - this.encoding = !StringUtils.hasText(charEncoding) ? StandardCharsets.UTF_8 : Charset.forName(charEncoding); - - try { - InputStream is = request.getInputStream(); - this.rawData = IOUtils.toByteArray(is); // InputStream 을 별도로 저장한 다음 getReader() 에서 새 스트림으로 생성 - - // body 파싱 - String collect = this.getReader().lines().collect(Collectors.joining(System.lineSeparator())); - if (!StringUtils.hasText(collect)) { // body 가 없을경우 로깅 제외 - return; - } - if (request.getContentType() != null && request.getContentType().contains( - MediaType.MULTIPART_FORM_DATA_VALUE)) { // 파일 업로드시 로깅제외 - return; - } - JSONParser jsonParser = new JSONParser(); - Object parse = jsonParser.parse(collect); - if (parse instanceof JSONArray) { - JSONArray jsonArray = (JSONArray)jsonParser.parse(collect); - setParameter("requestBody", jsonArray.toJSONString()); - } else { - JSONObject jsonObject = (JSONObject)jsonParser.parse(collect); - @SuppressWarnings("rawtypes") - Iterator iterator = jsonObject.keySet().iterator(); - if (iterator.hasNext()) { - do { - String key = (String) iterator.next(); - setParameter(key, Checks.isNotEmpty(jsonObject.get(key)) ? jsonObject.get(key).toString().replace("\"", "\\\"") : ""); - } while (iterator.hasNext()); - } - } - } catch (Exception e) { - log.error("ReadableRequestWrapper init error", e); - } - } - - @Override - public String getParameter(String name) { - String[] paramArray = getParameterValues(name); - if (paramArray != null && paramArray.length > 0) { - return paramArray[0]; - } else { - return null; - } - } - - @Override - public Map getParameterMap() { - return Collections.unmodifiableMap(params); - } - - @Override - public Enumeration getParameterNames() { - return Collections.enumeration(params.keySet()); - } - - @Override - public String[] getParameterValues(String name) { - String[] result = null; - String[] dummyParamValue = params.get(name); - - if (dummyParamValue != null) { - result = new String[dummyParamValue.length]; - System.arraycopy(dummyParamValue, 0, result, 0, dummyParamValue.length); - } - return result; - } - - public void setParameter(String name, String value) { - String[] param = {value}; - setParameter(name, param); - } - - public void setParameter(String name, String[] values) { - params.put(name, values); - } - - @Override - public ServletInputStream getInputStream() { - final ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(this.rawData); - - return new ServletInputStream() { - @Override - public boolean isFinished() { - return false; - } - - @Override - public boolean isReady() { - return false; - } - - @Override - public void setReadListener(ReadListener readListener) { - // Do nothing - } - - public int read() { - return byteArrayInputStream.read(); - } - }; - } - - @Override - public BufferedReader getReader() { - return new BufferedReader(new InputStreamReader(this.getInputStream(), this.encoding)); - } - } -} diff --git a/src/main/java/cokr/xit/fims/framework/core/interceptor/MenuIntercepter.java b/src/main/java/cokr/xit/fims/framework/core/interceptor/MenuIntercepter.java index b593da29..bda82908 100644 --- a/src/main/java/cokr/xit/fims/framework/core/interceptor/MenuIntercepter.java +++ b/src/main/java/cokr/xit/fims/framework/core/interceptor/MenuIntercepter.java @@ -81,12 +81,7 @@ public class MenuIntercepter extends HandlerInterceptorAdapter { if(reqPath.contains("/framework/biz/cmm/mainPage")) { mv.addObject("allMenuList", allMenuList); - // XitRollingNotiVO notiVO = xitRollingNotiVO; - // if(XitCmmnUtil.notEmpty(notiVO.getBbsId())) { //BBS_ID 값이 없으면 롤링 미사용으로 간주(globals.properties의 Globals.Xit.RollingNotiBbsId 에서 설정 가능) - // notiVO.setList(xitFrameUnitService.findLatestBbsList(false)); - // mv.addObject("rollingNotiList", notiVO.getList()); - // } - mv.addObject("rollingNotiList", CacheServiceUtils.findLatestBbsList()); + } //요청페이지 정보 Setting diff --git a/src/main/java/cokr/xit/fims/framework/core/resolver/XitExcelViewResolver.java b/src/main/java/cokr/xit/fims/framework/core/resolver/XitExcelViewResolver.java deleted file mode 100644 index 741e4720..00000000 --- a/src/main/java/cokr/xit/fims/framework/core/resolver/XitExcelViewResolver.java +++ /dev/null @@ -1,177 +0,0 @@ -package cokr.xit.fims.framework.core.resolver; - -import org.apache.poi.hssf.usermodel.HSSFDataFormat; -import org.apache.poi.hssf.util.HSSFColor; -import org.apache.poi.ss.usermodel.*; -import org.apache.poi.ss.util.CellReference; -import org.apache.poi.xssf.streaming.SXSSFSheet; -import org.apache.poi.xssf.streaming.SXSSFWorkbook; -import org.codehaus.jettison.json.JSONArray; -import org.codehaus.jettison.json.JSONObject; -import org.springframework.web.servlet.view.AbstractView; - -import javax.servlet.ServletOutputStream; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.lang.reflect.Method; -import java.util.List; -import java.util.Map; - -public class XitExcelViewResolver extends AbstractView { - - - /** The content type for an Excel response */ - private static final String CONTENT_TYPE = "application/vnd.ms-excel"; - - public XitExcelViewResolver() { - setContentType(CONTENT_TYPE); - } - - /* (non-Javadoc) - * @see org.springframework.web.servlet.view.AbstractView#renderMergedOutputModel(java.util.Map, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) - */ - @SuppressWarnings({ "unchecked", "rawtypes" }) - @Override - protected void renderMergedOutputModel(Map model, HttpServletRequest request, - HttpServletResponse response) throws Exception { - // TODO Auto-generated method stub - try { - - Workbook workbook = new SXSSFWorkbook(1000); - Sheet sheet = workbook.createSheet(); - - List list = (List)model.get("contents"); - String columns = (String)model.get("header"); - JSONObject jsnobject = new JSONObject("{\"columns\":"+columns+"}"); - JSONArray jsonArray = jsnobject.getJSONArray("columns"); - - String[] numberCheck = new String[jsonArray.length()]; - - Row row = null; - int rowCount = 0; - row = sheet.createRow(rowCount++); - - //일반 스타일 - CellStyle cellStyleTitle = row.getSheet().getWorkbook().createCellStyle(); - cellStyleTitle.setAlignment(HorizontalAlignment.CENTER); - cellStyleTitle.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex()); //색 설정 - cellStyleTitle.setFillPattern(FillPatternType.SOLID_FOREGROUND); //색 패턴 설정 - //cellStyleTitle.setFillBackgroundColor(IndexedColors.GREY_25_PERCENT.getIndex()); - //cellStyleTitle.setFillPattern(CellStyle.SOLID_FOREGROUND); - - //금액 스타일 - CellStyle cellStyleAmt = workbook.createCellStyle(); - cellStyleAmt.setDataFormat(HSSFDataFormat.getBuiltinFormat("#,##0")); //금액 - - //합계 스타일 설정 - CellStyle sumCellStyle = workbook.createCellStyle(); - sumCellStyle.setBorderRight(BorderStyle.THIN); //테두리 라인 - sumCellStyle.setBorderLeft(BorderStyle.THIN); //테두리 라인 - sumCellStyle.setBorderTop(BorderStyle.THIN); //테두리 라인 - sumCellStyle.setBorderBottom(BorderStyle.THIN); //테두리 라인 - sumCellStyle.setFillForegroundColor(HSSFColor.HSSFColorPredefined.PALE_BLUE.getIndex()); //배경색 - sumCellStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); //배경색 - sumCellStyle.setDataFormat(HSSFDataFormat.getBuiltinFormat("#,##0")); //금액 - - /* ==================== - * 헤더(head) 출력 - ==================== */ - for ( int i=0; i < jsonArray.length(); i++ ) { - //S로 초기화 - numberCheck[i] = "S"; - - Cell cell = row.createCell(i); - cell.setCellStyle(cellStyleTitle); - cell.setCellValue(jsonArray.getJSONObject(i).getString("title")); - } - - /* ==================== - * 바디(body) 출력 - ==================== */ - for ( Object rowData : list ) { - System.out.println("데이터 생성오류 row:" + rowCount); - row = sheet.createRow(rowCount++); - // manually control how rows are flushed to disk - if (rowCount % 500 == 0) { - ((SXSSFSheet) sheet).flushRows(500); // retain 100 last rows and flush all others - } - - for ( int i=0; i map = (Map) rowData; - obj = map.get(id_txt); - }else { - String _getterMethodName = "get" + id_txt.substring(0, 1).toUpperCase() + id_txt.substring(1); - Method _getterMethod = rowData.getClass().getMethod(_getterMethodName, (Class[])null); - obj = _getterMethod.invoke(rowData, (Object[])null); - } - - //data type별 Cell 출력 - if(obj instanceof Number){ - String title_txt = jsonArray.getJSONObject(i).getString("title"); //컬럼명 - if(!title_txt.equals("NO")){ - //숫자스타일 적용 - cell.setCellStyle(cellStyleAmt); - numberCheck[i] = "N"; - } - - Double data = Double.valueOf(String.valueOf(obj)); - cell.setCellType(CellType.NUMERIC); - cell.setCellValue(("null").equals(data)?0:data); - - } else { - String data = String.valueOf(obj); - if ( data.length() == 8 && ( id_txt.matches(".*_DE") || id_txt.matches(".*BIRTH") ) ){ - data = data.substring(0, 4) + "-" + data.substring(4, 6) + "-" + data.substring(6, 8); - } - cell.setCellValue(("null").equals(data)?"":data); - } - - sheet.autoSizeColumn(i); - sheet.setColumnWidth(i, (sheet.getColumnWidth(i)) + 512 ); - } - } - - - /* ==================== - * 푸터(footer) 출력 - ==================== */ - //합계 - int firstRow = 1; - row = sheet.createRow(rowCount++); - for ( int i=0; i < jsonArray.length(); i++ ) { - Cell cell = row.createCell(i); - cell.setCellStyle(sumCellStyle); - - String title_txt = jsonArray.getJSONObject(i).getString("title"); - //title이 "NO"일 경우 합계제외 - if(!title_txt.equals("NO")) - continue; - //첫줄이 숫자형식일 경우만 formula 적용 - if(numberCheck[i].equals("N")){ - // Cell Reference - CellReference cellRef1 = new CellReference(firstRow, cell.getColumnIndex()); - String fromStr = cellRef1.formatAsString(); - CellReference cellRef2 = new CellReference(row.getRowNum()-1, cell.getColumnIndex()); - String toStr = cellRef2.formatAsString(); - - cell.setCellType(CellType.NUMERIC); - cell.setCellFormula("SUM(" + fromStr + ":" + toStr + ")"); - } - } - - ServletOutputStream out = response.getOutputStream(); - workbook.write(out); - - if (out != null) out.close(); - } catch (Exception e) { - throw e; - } - - } -} diff --git a/src/main/java/cokr/xit/fims/framework/core/resolver/XitExceptionResolver.java b/src/main/java/cokr/xit/fims/framework/core/resolver/XitExceptionResolver.java deleted file mode 100644 index 20bb09d6..00000000 --- a/src/main/java/cokr/xit/fims/framework/core/resolver/XitExceptionResolver.java +++ /dev/null @@ -1,75 +0,0 @@ -package cokr.xit.fims.framework.core.resolver; - -import cokr.xit.fims.framework.core.message.XitMessageSource; -import cokr.xit.fims.framework.support.util.AjaxUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.security.access.AccessDeniedException; -import org.springframework.web.servlet.ModelAndView; -import org.springframework.web.servlet.handler.SimpleMappingExceptionResolver; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -/** - * - * @업무그룹명: 예외처리 resolver 클래스 - * @설명: 서비스 호출방식(submit, ajax)에 따라 exception을 handling 한다. - * @최초작성일: 2020. 3. 20. 오후 2:56:55 - * @최초작성자: 박민규 - * @author (주)엑스아이티 개발팀 - * @since 2002. 2. 2. - * @version 1.0 Copyright(c) XIT All rights reserved. - */ -public class XitExceptionResolver extends SimpleMappingExceptionResolver{ - private static final Logger logger = LoggerFactory.getLogger(XitExceptionResolver.class); - private String ajaxErrorView; - private XitMessageSource xitMessageSource; - - @Override - protected ModelAndView doResolveException(HttpServletRequest request, HttpServletResponse response, - Object handler, Exception ex) { - StackTraceElement[] stackElement = ex.getStackTrace(); - if(stackElement.length>0){ - logger.error(String.format("[ERROR Package] %s" , stackElement[0].getClassName() )); - logger.error(String.format("[ERROR Point] Class->%s:%s Method->%s", stackElement[0].getFileName(), stackElement[0].getLineNumber(), stackElement[0].getMethodName())); - } - logger.error("[ERROR PrintStackTrace]:::", ex); - - try { - if(ex.getMessage().indexOf("java.sql.SQLSyntaxErrorException")>-1) - ex = new RuntimeException("SQL 구문 오류가 발생 했습니다."); - else if(ex.getMessage().indexOf("java.sql.SQL")>-1) - ex = new RuntimeException("SQL 오류가 발생 했습니다."); - else if(ex.getMessage().indexOf("org.apache.ibatis.reflection.ReflectionException: There is no getter for property named")>-1) - ex = new RuntimeException("SQL 바인딩 변수의 getter가 없습니다."); - - if(ex instanceof AccessDeniedException) - ex = new RuntimeException(xitMessageSource.getMessage("custom.fail.accessDenied"), ex); - } catch (Exception e) {} - - //String isAJAX = request.getHeader("AJAX")==null?"false":request.getHeader("AJAX"); - if(AjaxUtils.isAjaxRequest(request)){ - String viewName = ajaxErrorView; - applyStatusCodeIfPossible(request, response, 500); - return getModelAndView(viewName, ex, request); - }else{ - return super.doResolveException(request, response, handler, ex); - } - } - - public String getAjaxErrorView() { - return ajaxErrorView; - } - - public void setAjaxErrorView(String ajaxErrorView) { - this.ajaxErrorView = ajaxErrorView; - } - - public void setXitMessageSource(XitMessageSource xitMessageSource) { - this.xitMessageSource = xitMessageSource; - } - - - -} diff --git a/src/main/java/cokr/xit/fims/framework/core/utils/XitCmmnUtil.java b/src/main/java/cokr/xit/fims/framework/core/utils/XitCmmnUtil.java index e6f0242c..3f8328de 100644 --- a/src/main/java/cokr/xit/fims/framework/core/utils/XitCmmnUtil.java +++ b/src/main/java/cokr/xit/fims/framework/core/utils/XitCmmnUtil.java @@ -3,8 +3,6 @@ package cokr.xit.fims.framework.core.utils; import cokr.xit.fims.framework.biz.cmm.XitLoginVO; import cokr.xit.fims.framework.support.util.AjaxUtils; import org.egovframe.rte.fdl.security.userdetails.util.EgovUserDetailsHelper; -import org.json.simple.JSONObject; -import org.springframework.ui.Model; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; @@ -784,64 +782,7 @@ public class XitCmmnUtil { return sb.toString(); } - - /** - *
메소드 설명: Model에 담긴 모든 key,value를 Json 포맷 문자열로 변환 후 반환 한다.
-     * 	ex) Model model = new HashMap
-     * 		model.put("key1", "value1");
-     * 		model.put("key2", "value2");
-     * 		model.put("key3", "value3");
-     *    -> {"key1":"value1","key2":"value2","key3":"value3"}
-     * 
- * @param model Model; - * @return String 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2019. 12. 16. - */ - @SuppressWarnings("unchecked") - public static String convertJsonFmtStrFromModel(Model model) { - - Map map = model.asMap(); - - JSONObject json = new JSONObject(); - - for (Map.Entry entry : map.entrySet()) { - String key = entry.getKey(); - Object value = entry.getValue(); - - // json.addProperty(key, value); - - json.put(key, value); - - } - return json.toString(); - - /** - * json 포맷 문자열로 변환 - */ -// StringBuffer sb = new StringBuffer(); -// Iterator it = map.keySet().iterator(); -// sb.append("{"); -// int i=0; -// while(it.hasNext()) { -// String key = it.next(); -// String value = String.valueOf(map.get(key)); -// if(i>0) -// sb.append(","); -//// try { -//// sb.append( String.format("\"%s\":\"%s\"", key, XitCmmnUtil.isEmpty(value)?"":URLEncoder.encode(value, "UTF-8") ) ); -//// } catch (UnsupportedEncodingException e) { -//// e.printStackTrace(); -//// } -// sb.append( String.format("\"%s\":\"%s\"", key, XitCmmnUtil.isEmpty(value)?"":value) ); -// i++; -// } -// sb.append("}"); -// -// return sb.toString(); - } - diff --git a/src/main/java/cokr/xit/fims/framework/core/utils/XitEmailUtil.java b/src/main/java/cokr/xit/fims/framework/core/utils/XitEmailUtil.java deleted file mode 100644 index 587f62fb..00000000 --- a/src/main/java/cokr/xit/fims/framework/core/utils/XitEmailUtil.java +++ /dev/null @@ -1,123 +0,0 @@ -package cokr.xit.fims.framework.core.utils; - -import org.apache.commons.mail.DefaultAuthenticator; -import org.apache.commons.mail.EmailAttachment; -import org.apache.commons.mail.EmailException; -import org.apache.commons.mail.MultiPartEmail; - -import java.io.Serializable; - -/** - * - *
    - *
  • 업무 그룹명: 메일발송 도구
  • - *
  • 설 명: 메일발송 서비스를 기술한다
  • - *
  • 작성일: 2018. 8. 29. 오후 2:03:26 - *
- * - * @author 박민규 - * - */ - -public class XitEmailUtil implements Serializable { - - private static final long serialVersionUID = -4322006921324597283L; - private String id; - private String password; - private int port; - private String host; - private String emailAddress; - private String senderName; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public int getPort() { - return port; - } - - public void setPort(int port) { - this.port = port; - } - - public String getHost() { - return host; - } - - public void setHost(String host) { - this.host = host; - } - - public String getEmailAddress() { - return emailAddress; - } - - public void setEmailAddress(String emailAddress) { - this.emailAddress = emailAddress; - } - - public String getSenderName() { - return senderName; - } - - public void setSenderName(String senderName) { - this.senderName = senderName; - } - - @Deprecated - public String send() throws EmailException { - MultiPartEmail email = new MultiPartEmail(); - - email.setCharset("UTF-8"); - email.setHostName(this.host); - email.setSmtpPort(this.port); - email.setStartTLSEnabled(true); - email.setAuthenticator(new DefaultAuthenticator(this.id, this.password)); - email.setSocketConnectionTimeout(60000); - email.setSocketTimeout(60000); - email.setFrom(this.emailAddress, this.senderName); - - return email.send(); - } - - public String send(String addTo, String subject, String msg) throws EmailException { - return send(addTo, subject, msg, null); - } - - public String send(String addTo, String subject, String msg, EmailAttachment attachment) throws EmailException { - MultiPartEmail email = new MultiPartEmail(); - - email.setCharset("UTF-8"); - email.setHostName(this.host); - email.setSmtpPort(this.port); - email.setStartTLSEnabled(true); - email.setAuthenticator(new DefaultAuthenticator(this.id, this.password)); - email.setSocketConnectionTimeout(60000); - email.setSocketTimeout(60000); - email.setFrom(this.emailAddress, this.senderName); - email.addTo(addTo); - email.setSubject(subject); - email.setMsg(msg); - - if (attachment != null) { - email.attach(attachment); - } - - return email.send(); - - } - -} diff --git a/src/main/java/cokr/xit/fims/framework/core/utils/XitExcelZipMapping.java b/src/main/java/cokr/xit/fims/framework/core/utils/XitExcelZipMapping.java deleted file mode 100644 index bc015413..00000000 --- a/src/main/java/cokr/xit/fims/framework/core/utils/XitExcelZipMapping.java +++ /dev/null @@ -1,51 +0,0 @@ -package cokr.xit.fims.framework.core.utils; - -import cokr.xit.fims.framework.biz.cmm.XitZipVO; -import org.apache.poi.ss.usermodel.Cell; -import org.apache.poi.ss.usermodel.Row; -import org.egovframe.rte.fdl.excel.EgovExcelMapping; -import org.egovframe.rte.fdl.excel.util.EgovExcelUtil; - -/** - * - * @업무그룹명: 우편번호 매핑 클래스 - * @설명: 전자정부프레임웍에서 제공하는 EgovExcelService 클래스를 이용하여 우편번호 일괄 등록을 위한 매핑 클래스 - * org.egovframe.rte.fdl.excel.impl.EgovExcelserviceImpl - * @최초작성일: 2020. 4. 21. 오전 10:42:29 - * @최초작성자: 박민규 - * @author (주)엑스아이티 개발팀 - * @since 2002. 2. 2. - * @version 1.0 Copyright(c) XIT All rights reserved. - */ -public class XitExcelZipMapping extends EgovExcelMapping { - - /** - * 우편번호 엑셀파일 맵핑 - */ - @Override - public Object mappingColumn(Row row) { - Cell cell0 = row.getCell((short) 0); - Cell cell1 = row.getCell((short) 1); - Cell cell2 = row.getCell((short) 2); - Cell cell3 = row.getCell((short) 3); - Cell cell4 = row.getCell((short) 4); - Cell cell5 = row.getCell((short) 5); - Cell cell6 = row.getCell((short) 6); - Cell cell7 = row.getCell((short) 7); - - XitZipVO vo = new XitZipVO(); - - vo.setZip (EgovExcelUtil.getValue(cell0)); - vo.setSn (EgovExcelUtil.getValue(cell1)); - vo.setCtprvnNm (EgovExcelUtil.getValue(cell2)); - vo.setSggNm (EgovExcelUtil.getValue(cell3)); - vo.setEmdNm (EgovExcelUtil.getValue(cell4)); - vo.setRgtr(EgovExcelUtil.getValue(cell7)); - - if (cell5 != null) {vo.setLiBuldNm (EgovExcelUtil.getValue(cell5));} - if (cell6 != null) {vo.setLnbrDongHo(EgovExcelUtil.getValue(cell6));} - - - return vo; - } -} diff --git a/src/main/java/cokr/xit/fims/framework/core/utils/XitProperties.java b/src/main/java/cokr/xit/fims/framework/core/utils/XitProperties.java index c0db8b9e..aa57999f 100644 --- a/src/main/java/cokr/xit/fims/framework/core/utils/XitProperties.java +++ b/src/main/java/cokr/xit/fims/framework/core/utils/XitProperties.java @@ -31,18 +31,13 @@ public class XitProperties{ //파일구분자 static final char FILE_SEPARATOR = File.separatorChar; - //프로퍼티 파일의 물리적 위치 - /*public static final String GLOBALS_PROPERTIES_FILE - = System.getProperty("user.home") + System.getProperty("file.separator") + "egovProps" - + System.getProperty("file.separator") + "globals.properties";*/ + public static final String RELATIVE_PATH_PREFIX = XitProperties.class.getClassLoader().getResource("xitProps").getPath(); //+ System.getProperty("file.separator") + ".." + System.getProperty("file.separator") //+ ".." + System.getProperty("file.separator") + ".." + System.getProperty("file.separator"); - public static final String GLOBALS_PROPERTIES_FILE - //= RELATIVE_PATH_PREFIX + "xitProps" + System.getProperty("file.separator") + "globals.properties"; - = RELATIVE_PATH_PREFIX + "globals.properties"; + public static final String GLOBALS_PROPERTIES_FILE = RELATIVE_PATH_PREFIX + "globals.properties"; diff --git a/src/main/java/cokr/xit/fims/framework/core/utils/XitSftpUtil.java b/src/main/java/cokr/xit/fims/framework/core/utils/XitSftpUtil.java deleted file mode 100644 index af71a9f1..00000000 --- a/src/main/java/cokr/xit/fims/framework/core/utils/XitSftpUtil.java +++ /dev/null @@ -1,336 +0,0 @@ -package cokr.xit.fims.framework.core.utils; - -import com.jcraft.jsch.*; -import com.jcraft.jsch.ChannelSftp.LsEntry; - -import java.io.*; -import java.util.ArrayList; -import java.util.List; -import java.util.Vector; - - -/** - * - *
    - *
  • 업무 그룹명: SFTP 도구
  • - *
  • 설 명:
  • - *
  • 작성일: 2019. 9. 30. 오후 6:41:26 - *
- * - * @author 박민규 - * - */ -public class XitSftpUtil { - private Session session = null; - private JSch jsch; - private Channel channel; - private ChannelSftp sftpChannel; - private String user; - private String host; - private int port; - private String password; - - public XitSftpUtil(String host, int port, String user, String password) { - this.host = host; - this.port = port; - this.user = user; - this.password = password; - } - - /** - *
메소드 설명: SFTP 접속 연결
- * @throws JSchException void 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2019. 9. 30. - */ - private void connect() throws JSchException { - System.out.println("connecting..."+host); - // 1. JSch 객체를 생성한다. - jsch = new JSch(); - // 2. 세션 객체를 생성한다(사용자 이름, 접속할 호스트, 포트를 인자로 전달한다.) - session = jsch.getSession(user, host,port); - // 4. 세션과 관련된 정보를 설정한다. - session.setConfig("StrictHostKeyChecking", "no"); - // 4. 패스워드를 설정한다. - session.setPassword(password); - // 5. 접속한다. - session.connect(); - // 6. sftp 채널을 연다. - channel = session.openChannel("sftp"); - // 7. 채널에 연결한다. - channel.connect(); - // 8. 채널을 SFTP용 채널 객체로 캐스팅한다. - sftpChannel = (ChannelSftp) channel; - } - - /** - *
메소드 설명: SFTP 접속 해제
- * void 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2019. 9. 30. - */ - private void disconnect() { - if(session.isConnected()){ - System.out.println("disconnecting..."); - sftpChannel.disconnect(); - channel.disconnect(); - session.disconnect(); - } - } - - - /** - *
메소드 설명: 파일 업로드
- * @param localPathName 업로드 파일 로컬 경로(파일명 포함) - * @param remoteDirPath 원격지 디렉토리 경로 - * @throws Exception void 요청처리 후 응답객체 - * @author: 박민규 - * @throws Exception - * @date: 2019. 9. 30. - */ - public void upload(String localPathName, String remoteDirPath) throws Exception { - FileInputStream fis = null; - // 앞서 만든 접속 메서드를 사용해 접속한다. - connect(); - try { - // Change to output directory - sftpChannel.cd(remoteDirPath); - - // Upload file - File file = new File(localPathName); - // 입력 파일을 가져온다. - fis = new FileInputStream(file); - // 파일을 업로드한다. - sftpChannel.put(fis, file.getName()); - - fis.close(); - System.out.println("File uploaded successfully - "+ file.getAbsolutePath()); - } catch (SftpException e) { - throw e; - } catch (FileNotFoundException e) { - throw e; - } catch (IOException e) { - throw e; - } finally { - disconnect(); - } - } - - - /** - *
메소드 설명: 파일 다운로드
- * @param remotePathName 원격지 파일 경로(파일명 포함) - * @param localDirPath 로컬 다운로드 경로 - * @throws Exception void 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2019. 9. 30. - */ - public void download(String remotePathName, String localDirPath) throws Exception { - byte[] buffer = new byte[1024]; - BufferedInputStream bis; - connect(); - try { - // Change to output directory - String cdDir = remotePathName.substring(0, remotePathName.lastIndexOf("/") + 1); - sftpChannel.cd(cdDir); - - File file = new File(remotePathName); - bis = new BufferedInputStream(sftpChannel.get(file.getName())); - - File newFile = new File(localDirPath + "/" + file.getName()); - - // Download file - OutputStream os = new FileOutputStream(newFile); - BufferedOutputStream bos = new BufferedOutputStream(os); - int readCount; - while ((readCount = bis.read(buffer)) > 0) { - bos.write(buffer, 0, readCount); - } - bis.close(); - bos.close(); - System.out.println("File downloaded successfully - "+ file.getAbsolutePath()); - - } catch (SftpException e) { - throw e; - } catch (FileNotFoundException e) { - throw e; - } catch (IOException e) { - throw e; - } finally { - disconnect(); - } - - } - - - - /** - *
메소드 설명: 파일 목록 다운로드
- * @param remotePathName 원격지 파일 경로(파일명 포함) - * @param localDirPath 로컬 다운로드 경로 - * @throws Exception void 요청처리 후 응답객체 - * @author: 박민규 - * @date: 2019. 9. 30. - */ - @SuppressWarnings("unchecked") - public void downloads(String remotePathName, String localDirPath, String startsWithFileName, String endsWithFileName) throws Exception { - byte[] buffer = new byte[1024]; - BufferedInputStream bis; - connect(); - try { - // Change to output directory - String cdDir = remotePathName.substring(0, remotePathName.lastIndexOf("/") + 1); - sftpChannel.cd(cdDir); - - // File List - List arrFile = new ArrayList(); - Vector vector = sftpChannel.ls(remotePathName); -// LsEntrySelector selector = new lsen -// Vector vector = sftpChannel.ls(remotePathName, startsWithFileName); -// String cmd = String.format("%s | grep %s", remotePathName, startsWithFileName); -// System.out.println(cmd); - for(LsEntry lsEntry : vector) { - System.out.println(lsEntry.getFilename()); - if(lsEntry.getFilename().startsWith(startsWithFileName)&&lsEntry.getFilename().endsWith(endsWithFileName)) - arrFile.add(new File(remotePathName+lsEntry.getFilename())); - } - - for(File file : arrFile) { - bis = new BufferedInputStream(sftpChannel.get(file.getName())); - File newFile = new File(localDirPath + "/" + file.getName()); - - // Download file - OutputStream os = new FileOutputStream(newFile); - BufferedOutputStream bos = new BufferedOutputStream(os); - int readCount; - while ((readCount = bis.read(buffer)) > 0) { - bos.write(buffer, 0, readCount); - } - bis.close(); - bos.close(); - System.out.println("File downloaded successfully - "+ file.getAbsolutePath()); - } - - } catch (SftpException e) { - throw e; - } catch (FileNotFoundException e) { - throw e; - } catch (IOException e) { - throw e; - } finally { - disconnect(); - } - - } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -// private Session session = null; -// private Channel channel = null; -// private ChannelSftp channelSftp = null; -// -// public void init(){ -// String url = "..."; -// String user = "..."; -// String password = "..."; -// -// System.out.println(url); -// //JSch 객체 생성 -// JSch jsch = new JSch(); -// try { -// //세션객체 생성 ( user , host, port ) -// session = jsch.getSession(user, url); -// -// //password 설정 -// session.setPassword(password); -// -// //세션관련 설정정보 설정 -// java.util.Properties config = new java.util.Properties(); -// -// //호스트 정보 검사하지 않는다. -// config.put("StrictHostKeyChecking", "no"); -// session.setConfig(config); -// -// //접속 -// session.connect(); -// -// //sftp 채널 접속 -// channel = session.openChannel("sftp"); -// channel.connect(); -// -// } catch (JSchException e) { -// e.printStackTrace(); -// } -// channelSftp = (ChannelSftp) channel; -// -// } -// -// // 단일 파일 업로드 -// public void upload( String dir , File file){ -// FileInputStream in = null; -// -// try{ //파일을 가져와서 inputStream에 넣고 저장경로를 찾아 put -// in = new FileInputStream(file); -// channelSftp.cd(dir); -// channelSftp.put(in,file.getName()); -// }catch(SftpException e){ -// e.printStackTrace(); -// }catch(FileNotFoundException e){ -// e.printStackTrace(); -// }finally{ -// try{ -// in.close(); -// } catch(IOException ioe){ -// ioe.printStackTrace(); -// } -// } -// } -// -// // 단일 파일 다운로드 -// public InputStream download(String dir, String fileNm){ -// InputStream in = null; -// String path = "..."; -// try{ //경로탐색후 inputStream에 데이터를 넣음 -// channelSftp.cd(path+dir); -// in = channelSftp.get(fileNm); -// -// }catch(SftpException se){ -// se.printStackTrace(); -// } -// -// return in; -// } - -} diff --git a/src/main/java/cokr/xit/fims/framework/core/utils/egov/EgovDateUtil.java b/src/main/java/cokr/xit/fims/framework/core/utils/egov/EgovDateUtil.java index 84ddede3..53c29407 100644 --- a/src/main/java/cokr/xit/fims/framework/core/utils/egov/EgovDateUtil.java +++ b/src/main/java/cokr/xit/fims/framework/core/utils/egov/EgovDateUtil.java @@ -1,6 +1,5 @@ package cokr.xit.fims.framework.core.utils.egov; -import com.ibm.icu.util.ChineseCalendar; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -48,7 +47,7 @@ public class EgovDateUtil { * DateUtil.addYearMonthDay("20040229", 2, 0, 1) = "20060301" * * - * @param dateStr 날짜 문자열(yyyyMMdd, yyyy-MM-dd의 형식) + * @param sDate 날짜 문자열(yyyyMMdd, yyyy-MM-dd의 형식) * @param year 가감할 년. 0이 입력될 경우 가감이 없다 * @param month 가감할 월. 0이 입력될 경우 가감이 없다 * @param day 가감할 일. 0이 입력될 경우 가감이 없다 @@ -162,8 +161,8 @@ public class EgovDateUtil { * DateUtil.getDaysDiff("20060801","20060801") = 0 * * - * @param dateStr1 날짜 문자열(yyyyMMdd, yyyy-MM-dd의 형식) - * @param dateStr2 날짜 문자열(yyyyMMdd, yyyy-MM-dd의 형식) + * @param sDate1 날짜 문자열(yyyyMMdd, yyyy-MM-dd의 형식) + * @param sDate2 날짜 문자열(yyyyMMdd, yyyy-MM-dd의 형식) * @return 일 수 차이. * @throws IllegalArgumentException 날짜 포맷이 정해진 바와 다를 경우. * 입력 값이 null인 경우. @@ -204,7 +203,7 @@ public class EgovDateUtil { * DateUtil.checkDate("2006-02-28") = true * * - * @param dateStr 날짜 문자열(yyyyMMdd, yyyy-MM-dd의 형식) + * @param sDate 날짜 문자열(yyyyMMdd, yyyy-MM-dd의 형식) * @return 유효한 날짜인지 여부 */ public static boolean checkDate(String sDate) { @@ -289,7 +288,7 @@ public class EgovDateUtil { * ex) 20040101,ch(/) --> 2004/01/01 로 리턴 * * - * @param date yyyyMMdd 형식의 날짜문자열 + * @param sDate yyyyMMdd 형식의 날짜문자열 * @param ch 구분자 * @return 변환된 문자열 */ @@ -341,7 +340,7 @@ public class EgovDateUtil { * ex) 151241, ch(/) -> 15/12/31 * * - * @param str HH24MISS 형식의 시간문자열 + * @param sTime HH24MISS 형식의 시간문자열 * @param ch 구분자 * @return 변환된 문자열 */ @@ -514,89 +513,9 @@ public class EgovDateUtil { return randomDate; } - /** - * 입력받은 양력일자를 변환하여 음력일자로 반환 - * @param sDate 양력일자 - * @return 음력일자 - */ - public static Map toLunar(String sDate) { - String dateStr = validChkDate(sDate); - - Map hm = new HashMap(); - hm.put("day", ""); - hm.put("leap", "0"); - - if (dateStr.length() != 8) { - return hm; - } - - Calendar cal; - ChineseCalendar lcal; - - cal = Calendar.getInstance(); - lcal = new ChineseCalendar(); - - cal.set(Calendar.YEAR, Integer.parseInt(dateStr.substring(0, 4))); - cal.set(Calendar.MONTH, Integer.parseInt(dateStr.substring(4, 6)) - 1); - cal.set(Calendar.DAY_OF_MONTH, Integer.parseInt(dateStr.substring(6, 8))); - - lcal.setTimeInMillis(cal.getTimeInMillis()); - - String year = String.valueOf(lcal.get(ChineseCalendar.EXTENDED_YEAR) - 2637); - String month = String.valueOf(lcal.get(ChineseCalendar.MONTH) + 1); - String day = String.valueOf(lcal.get(ChineseCalendar.DAY_OF_MONTH)); - String leap = String.valueOf(lcal.get(ChineseCalendar.IS_LEAP_MONTH)); - - String pad4Str = "0000"; - String pad2Str = "00"; - - String retYear = (pad4Str + year).substring(year.length()); - String retMonth = (pad2Str + month).substring(month.length()); - String retDay = (pad2Str + day).substring(day.length()); - String SDay = retYear + retMonth + retDay; - hm.put("day", SDay); - hm.put("leap", leap); - return hm; - } - - /** - * 입력받은 음력일자를 변환하여 양력일자로 반환 - * @param sDate 음력일자 - * @param iLeapMonth 음력윤달여부(IS_LEAP_MONTH) - * @return 양력일자 - */ - public static String toSolar(String sDate, int iLeapMonth) { - String dateStr = validChkDate(sDate); - - Calendar cal; - ChineseCalendar lcal; - - cal = Calendar.getInstance(); - lcal = new ChineseCalendar(); - - lcal.set(ChineseCalendar.EXTENDED_YEAR, Integer.parseInt(dateStr.substring(0, 4)) + 2637); - lcal.set(ChineseCalendar.MONTH, Integer.parseInt(dateStr.substring(4, 6)) - 1); - lcal.set(ChineseCalendar.DAY_OF_MONTH, Integer.parseInt(dateStr.substring(6, 8))); - lcal.set(ChineseCalendar.IS_LEAP_MONTH, iLeapMonth); - - cal.setTimeInMillis(lcal.getTimeInMillis()); - - String year = String.valueOf(cal.get(Calendar.YEAR)); - String month = String.valueOf(cal.get(Calendar.MONTH) + 1); - String day = String.valueOf(cal.get(Calendar.DAY_OF_MONTH)); - - String pad4Str = "0000"; - String pad2Str = "00"; - - String retYear = (pad4Str + year).substring(year.length()); - String retMonth = (pad2Str + month).substring(month.length()); - String retDay = (pad2Str + day).substring(day.length()); - - return retYear + retMonth + retDay; - } /** * 입력받은 요일의 영문명을 국문명의 요일로 반환 @@ -812,7 +731,7 @@ public class EgovDateUtil { /** * 입력된 일자 문자열을 확인하고 8자리로 리턴 - * @param sDate + * @param dateStr * @return */ public static String validChkDate(String dateStr) { @@ -829,7 +748,7 @@ public class EgovDateUtil { /** * 입력된 일자 문자열을 확인하고 8자리로 리턴 - * @param sDate + * @param timeStr * @return */ public static String validChkTime(String timeStr) { diff --git a/src/main/java/cokr/xit/fims/framework/core/utils/json/ConvertHelper.java b/src/main/java/cokr/xit/fims/framework/core/utils/json/ConvertHelper.java deleted file mode 100644 index fdf2c355..00000000 --- a/src/main/java/cokr/xit/fims/framework/core/utils/json/ConvertHelper.java +++ /dev/null @@ -1,52 +0,0 @@ -package cokr.xit.fims.framework.core.utils.json; - -import com.fasterxml.jackson.core.JsonFactory; -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.datatype.joda.JodaModule; -import lombok.NoArgsConstructor; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.StringWriter; - -@NoArgsConstructor -public class ConvertHelper{ - private static final Logger log = LoggerFactory.getLogger(ConvertHelper.class); - private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); - private static final JsonFactory JSON_FACTORY = new JsonFactory(); - - public static String jsonToObject(Object o){ - JsonGenerator generator = null; - StringWriter writer = new StringWriter(); - - try{ - OBJECT_MAPPER.registerModule(new JodaModule()); - generator = JSON_FACTORY.createGenerator(writer); - OBJECT_MAPPER.writeValue(generator, o); - generator.flush(); - return writer.toString(); - }catch(Exception e){ - e.printStackTrace(); - return null; - }finally{ - if(generator != null){ - try{ - generator.close(); - }catch(Exception e){ - log.error("InternalServerError: {}", e.getLocalizedMessage()); - } - } - } - } - - public static T objectToJson(String json, Class clazz){ - try{ - OBJECT_MAPPER.registerModule(new JodaModule()); - return OBJECT_MAPPER.readValue(json, clazz); - }catch(Exception e){ - e.printStackTrace(); - return null; - } - } -} diff --git a/src/main/java/cokr/xit/fims/framework/support/converter/HTMLCharacterEscapes.java b/src/main/java/cokr/xit/fims/framework/support/converter/HTMLCharacterEscapes.java index a6166c86..dafa5f94 100644 --- a/src/main/java/cokr/xit/fims/framework/support/converter/HTMLCharacterEscapes.java +++ b/src/main/java/cokr/xit/fims/framework/support/converter/HTMLCharacterEscapes.java @@ -65,21 +65,6 @@ public class HTMLCharacterEscapes extends CharacterEscapes { return serializedString; } -// @Override -// public SerializableString getEscapeSequence(int ch) { -// //return new SerializedString(translator.translate(Character.toString((char) ch))); -// -// // 참고 - 커스터마이징이 필요없다면 아래와 같이 Apache Commons Lang3에서 제공하는 메서드를 써도 된다. -// return new SerializedString(StringEscapeUtils.escapeHtml4(Character.toString((char) ch))); -// } + } -/* - @Bean - public MappingJackson2HttpMessageConverter jsonEscapeConverter() { - // MappingJackson2HttpMessageConverter Default ObjectMapper 설정 및 ObjectMapper Config 설정 - ObjectMapper objectMapper = Jackson2ObjectMapperBuilder.json().build(); - objectMapper.getFactory().setCharacterEscapes(new HTMLCharacterEscapes()); - return new MappingJackson2HttpMessageConverter(objectMapper); - } - */ diff --git a/src/main/java/cokr/xit/fims/framework/support/exception/filter/ExceptionHandlerFilter.java b/src/main/java/cokr/xit/fims/framework/support/exception/filter/ExceptionHandlerFilter.java deleted file mode 100644 index b15890da..00000000 --- a/src/main/java/cokr/xit/fims/framework/support/exception/filter/ExceptionHandlerFilter.java +++ /dev/null @@ -1,64 +0,0 @@ -package cokr.xit.fims.framework.support.exception.filter; - -import cokr.xit.fims.framework.core.constants.ErrorCode; -import cokr.xit.fims.framework.core.ErrorResponse; -import cokr.xit.fims.framework.core.utils.json.ConvertHelper; -import cokr.xit.fims.framework.support.util.Checks; -import lombok.extern.slf4j.Slf4j; -import org.springframework.core.env.Environment; -import org.springframework.http.HttpStatus; -import org.springframework.web.filter.OncePerRequestFilter; - -import javax.servlet.FilterChain; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.Arrays; - -/** - * CustomExceptionHandler 와 함께 에러 처리 - * Filter에서 발생한 오류 처리 - */ -@Slf4j -//@Component -public class ExceptionHandlerFilter extends OncePerRequestFilter { - - private final Environment env; - - public ExceptionHandlerFilter(Environment env) { - this.env = env; - } - - @Override - protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException { - try{ - filterChain.doFilter(request,response); - - }catch (RuntimeException ex){ - log.error("runtime exception exception handler filter"); - setErrorResponse(HttpStatus.INTERNAL_SERVER_ERROR,response,ex); - } - } - - private void setErrorResponse(HttpStatus status, HttpServletResponse response,Throwable ex){ - response.setStatus(status.value()); - response.setContentType("application/json"); - ErrorResponse errorResponse = ErrorResponse.getErrorResponse(ErrorCode.INTERNAL_SERVER_ERROR); - - // 운영 환경인 경우는 상세 정보 미출력 - if(Arrays.asList(env.getActiveProfiles()).contains("prod")) - errorResponse.setMessage(Checks.isNotEmpty(ex.getCause())? ex.getLocalizedMessage() : ex.getCause().getLocalizedMessage()); - else - errorResponse.setMessage(Checks.isNotEmpty(ex.getCause())? ex.getLocalizedMessage() : ex.getCause().toString()); - try{ - String json = ConvertHelper.jsonToObject(errorResponse); - log.error(json); - response.getWriter().write(json); - }catch (IOException e){ - e.printStackTrace(); - } - - } -} - diff --git a/src/main/java/cokr/xit/fims/framework/support/exception/handling/ResponseExceptionAdvice.java b/src/main/java/cokr/xit/fims/framework/support/exception/handling/ResponseExceptionAdvice.java deleted file mode 100644 index 23ca1248..00000000 --- a/src/main/java/cokr/xit/fims/framework/support/exception/handling/ResponseExceptionAdvice.java +++ /dev/null @@ -1,294 +0,0 @@ -package cokr.xit.fims.framework.support.exception.handling; - -import cokr.xit.fims.framework.core.constants.ErrorCode; -import cokr.xit.fims.framework.core.ErrorResponse; -import cokr.xit.fims.framework.core.utils.json.ConvertHelper; -import cokr.xit.fims.framework.support.exception.BizRuntimeException; -import cokr.xit.fims.framework.support.exception.CustomBaseException; -import cokr.xit.fims.framework.support.util.Checks; -import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang3.StringUtils; -import org.springframework.core.MethodParameter; -import org.springframework.dao.DataIntegrityViolationException; -import org.springframework.http.HttpHeaders; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.converter.HttpMessageConverter; -import org.springframework.http.converter.HttpMessageNotReadableException; -import org.springframework.http.server.ServerHttpRequest; -import org.springframework.http.server.ServerHttpResponse; -import org.springframework.web.bind.MethodArgumentNotValidException; -import org.springframework.web.bind.annotation.ExceptionHandler; -import org.springframework.web.bind.annotation.ResponseStatus; -import org.springframework.web.context.request.WebRequest; -import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice; - -import javax.validation.ConstraintViolationException; -import java.io.IOException; -import java.io.OutputStream; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Optional; - -/** - *
- * ExceptionHandlerFilter(Filter에서 발생한 에러 처리)와 함께 에러 처리
- * ErrorCode 에서 해당 Exception 오류를 정의하여 사용
- *
- * spring boot의 기본 properties
- * server.error:
- *   include-exception: false # 응답에 exception의 내용을 포함할지 여부
- *   include-stacktrace: never # 오류 응답에 stacktrace 내용을 포함할 지 여부
- *   path: '/error' # 오류 응답을 처리할 Handler의 경로
- *   whitelabel.enabled: true # 서버 오류 발생시 브라우저에 보여줄 기본 페이지 생성 여부
- *   
- */ -@Slf4j -//@RestControllerAdvice -public class ResponseExceptionAdvice implements ResponseBodyAdvice { - - /** - * ControllerAdvice에서 처리되는 response가 xml 형태로 되는 경우 -> json 타입으로 전환 - * 1. supports에서 현재 Controller작업이 끝난 response를 beforeBodyWrite로 보낼 것인지 판단 - * 2. 보내게 되면 beforeBodyWrite에서 구현 - * @param returnType the return type - * @param converterType the selected converter type - * @return - */ - @Override - public boolean supports(MethodParameter returnType, Class> converterType) { - // 어느클래스에서 호출 되는지 : returnType.getDeclaringClass() - return "XitExceptionAdvice".equals(returnType.getDeclaringClass().getSimpleName()); - } - - - /** - * Controller 응답이 끝난 데이타(body)를 선택된 HttpMessageConverter로 데이터 변환후 return; - * @param body the body to be written - * @param returnType the return type of the controller method - * @param selectedContentType the content type selected through content negotiation - * @param selectedConverterType the converter type selected to write to the response - * @param request the current request - * @param response the current response - * @return - */ - @Override - public T beforeBodyWrite(T body, MethodParameter returnType, MediaType selectedContentType, - Class> selectedConverterType, ServerHttpRequest request, ServerHttpResponse response) { - - if(MediaType.APPLICATION_XML.equals(selectedContentType) || MediaType.APPLICATION_XHTML_XML.equals(selectedContentType)) { - if(body instanceof ErrorResponse){ - ErrorResponse er = (ErrorResponse)body; - try (OutputStream stream = response.getBody()) { - stream.write(ConvertHelper.jsonToObject(er).getBytes("UTF-8")); - stream.flush(); - return null; - } catch (IOException e) { - log.error(">>>>>>>>>>> XitRestControllerAdvice - XitExceptionAdvice json 응답으로 변환중 에러 발생 <<<<<<<<<<<<"); - return body; - } - } - } - - return body; - } - - /** - * CustomBaseException - * - * @param cbe CustomBaseException - * @return ErrorResponse - */ - @ExceptionHandler(value = {CustomBaseException.class}) - @ResponseStatus(value = HttpStatus.BAD_REQUEST) - protected ErrorResponse handleCustomBaseException(CustomBaseException cbe) { - log.error("==================== handleCustomBaseException throw CustomBaseException : {} ====================", cbe.getClass().getCanonicalName()); - return ErrorResponse.of(cbe); - } - - /** - * BizRuntimeException - * - * @param cbe BizRuntimeException - * @return ErrorResponse - */ - @ExceptionHandler(value = {BizRuntimeException.class}) - @ResponseStatus(value = HttpStatus.BAD_REQUEST) - protected ErrorResponse handleBizRuntimeException(BizRuntimeException cbe) { - log.error("==================== handleBizRuntimeException throw BizRuntimeException : {} ====================", cbe.getClass().getCanonicalName()); - return ErrorResponse.of(cbe); - } - - @ExceptionHandler(value = {MethodArgumentNotValidException.class}) - @ResponseStatus(value = HttpStatus.BAD_REQUEST) - protected ErrorResponse handleMethodArgumentNotValid( - MethodArgumentNotValidException ex, HttpHeaders headers, HttpStatus status, WebRequest request) { - log.error("==================== Override handleMethodArgumentNotValid throw MethodArgumentNotValidException ===================="); - - Map validErrorMap = new HashMap<>(); - ex.getBindingResult().getFieldErrors() - .forEach(e -> validErrorMap.put(e.getField(), e.getDefaultMessage())); - - log.error("##############################################################################################"); - log.error("{}", validErrorMap); - log.error("##############################################################################################"); - - Optional firstKey = validErrorMap - .keySet() - .stream() - .findFirst(); - - - Optional firstMessage = validErrorMap - .values() - .stream() - .findFirst(); - - String errMsg = "["+firstKey.orElse("에러 메세지가 정의 되지 않았습니다")+"] "+firstMessage.orElse(""); - - return ErrorResponse.of(HttpStatus.BAD_REQUEST.toString(), errMsg); - } - - /** - * Customize the response for HttpMessageNotReadableException. - *

This method delegates to {@link HttpMessageNotReadableException}. - * @param ex the exception - * @param headers the headers to be written to the response - * @param status the selected response status - * @param request the current request - * @return a {@code ResponseEntity} instance - */ - @ExceptionHandler(HttpMessageNotReadableException.class) - @ResponseStatus(value = HttpStatus.BAD_REQUEST) - protected ErrorResponse handleHttpMessageNotReadable( - HttpMessageNotReadableException ex, HttpHeaders headers, HttpStatus status, WebRequest request) { - log.error("==================== Override handleHttpMessageNotReadable throw HttpMessageNotReadableException ===================="); - return ErrorResponse.of(HttpStatus.BAD_REQUEST.toString(), ex.getLocalizedMessage()); - } - - /** - * NoSuchElementException - * - * @return ErrorResponse - */ - @ExceptionHandler(value = {NoSuchElementException.class}) - @ResponseStatus(value = HttpStatus.BAD_REQUEST) - protected ErrorResponse handleNoSuchElementException() { - log.error("==================== handleNoSuchElementException throw NoSuchElementException ===================="); - return ErrorResponse.of(ErrorCode.SQL_DATA_RESOURCE_INVALID); - } - - /** - * NoSuchElementException - * - * @return ErrorResponse - */ - @ExceptionHandler(value = {IllegalArgumentException.class}) - @ResponseStatus(value = HttpStatus.BAD_REQUEST) - protected ErrorResponse handleIllegalArgumentException(IllegalArgumentException iae) { - log.error("==================== handleIllegalArgumentException throw llegalArgumentException ===================="); - return ErrorResponse.of(HttpStatus.BAD_REQUEST.toString(), iae.getLocalizedMessage()); - } - - /** - * Data 중복 - * - * @return ErrorResponse - */ - @ExceptionHandler(value = {ConstraintViolationException.class}) - @ResponseStatus(value = HttpStatus.BAD_REQUEST) - protected ErrorResponse handleDataException() { - log.error("==================== handleDataException throw ConstraintViolationException ===================="); - return ErrorResponse.of(ErrorCode.SQL_DATA_RESOURCE_INVALID); - } - - - - // @ExceptionHandler(value = {MySQLSyntaxErrorException.class}) - // @ResponseStatus(value = HttpStatus.NOT_ACCEPTABLE) - // protected ErrorResponse handleMySQLSyntaxErrorException(MySQLSyntaxErrorException e) { - // String message = Checks.isNotNull(e) ? e.getLocalizedMessage() : StringUtils.EMPTY; - // log.error("==================== handleMySQLSyntaxErrorException throw MySQLSyntaxErrorException ===================="); - // return ErrorResponse.of(ErrorCode.SQL_DATA_RESOURCE_INVALID.toString(), message); - // } - - @ExceptionHandler(value = {SQLException.class}) - @ResponseStatus(value = HttpStatus.NOT_ACCEPTABLE) - protected ErrorResponse handleSQLException(SQLException e) { - String message = Checks.isNotNull(e) ? e.getLocalizedMessage() : StringUtils.EMPTY; - log.error("==================== handleSQLException throw SQLException ===================="); - return ErrorResponse.of(ErrorCode.SQL_DATA_RESOURCE_INVALID.toString(), message); - } - - @ExceptionHandler(value = {DataIntegrityViolationException.class}) - @ResponseStatus(value = HttpStatus.NOT_ACCEPTABLE) - protected ErrorResponse handleDataIntegrityViolationException(DataIntegrityViolationException e) { - String message = Checks.isNotNull(e) ? e.getLocalizedMessage() : StringUtils.EMPTY; - log.error("==================== handleDataIntegrityViolationException throw DataIntegrityViolationException ===================="); - return ErrorResponse.of(ErrorCode.SQL_DATA_RESOURCE_INVALID.toString(), message); - } - - /** - * RuntimeException - * - * @param e RuntimeException - * @return ErrorResponse - */ - @ExceptionHandler(value = {RuntimeException.class}) - @ResponseStatus(value = HttpStatus.INTERNAL_SERVER_ERROR) - protected ErrorResponse handleRuntimeException(RuntimeException e) { - String message = Checks.isNotNull(e) ? e.getLocalizedMessage() : StringUtils.EMPTY; - log.error("handleException RuntimeException : {}", Checks.isEmpty(message) ? StringUtils.EMPTY : e.getClass().getCanonicalName()); - return ErrorResponse.of(HttpStatus.INTERNAL_SERVER_ERROR.toString(), message); - //return ErrorResponse.of(e); - } - - /** - * Exception - * - * @param e Exception - * @return ErrorResponse - */ - @ExceptionHandler(value = {Exception.class}) - @ResponseStatus(value = HttpStatus.INTERNAL_SERVER_ERROR) - protected ErrorResponse handleException(Exception e) { - String message = Checks.isNotNull(e) ? e.getLocalizedMessage() : StringUtils.EMPTY; - log.error("handleException throw Exception : {}", Checks.isEmpty(message) ? StringUtils.EMPTY : e.getClass().getCanonicalName()); - return ErrorResponse.of(HttpStatus.INTERNAL_SERVER_ERROR.toString(), message); - } -} - -/* -//TODO :: 공통 framework에 반영 필요 -javax.validation.constraints @NotNull - - -@ExceptionHandler(MethodArgumentNotValidException.class) - public ResponseEntity> methodArgumentValidException(MethodArgumentNotValidException e) { - return ResponseEntity.badRequest().body(extractErrorMessages(e)); - } - - private List extractErrorMessages(MethodArgumentNotValidException e) { - return e.getBindingResult() - .getAllErrors() - .stream() - .map(DefaultMessageSourceResolvable::getDefaultMessage) - .map(ExceptionDto::new) - .collect(Collectors.toList()); - } - - @ExceptionHandler(ConstraintViolationException.class) - public ResponseEntity> constraintViolationException(ConstraintViolationException e) { - return ResponseEntity.badRequest().body(extractErrorMessages(e)); - } - - private List extractErrorMessages(ConstraintViolationException e) { - return e.getConstraintViolations() - .stream() - .map(ConstraintViolation::getMessage) - .map(ExceptionDto::new) - .collect(Collectors.toList()); - } - */ diff --git a/src/main/java/cokr/xit/fims/framework/support/exception/resolver/AjaxExceptionViewResolver.java b/src/main/java/cokr/xit/fims/framework/support/exception/resolver/AjaxExceptionViewResolver.java index 380ce065..5df0228f 100644 --- a/src/main/java/cokr/xit/fims/framework/support/exception/resolver/AjaxExceptionViewResolver.java +++ b/src/main/java/cokr/xit/fims/framework/support/exception/resolver/AjaxExceptionViewResolver.java @@ -19,8 +19,7 @@ import java.util.Map; @Slf4j public class AjaxExceptionViewResolver extends AbstractExceptionViewResolver { - @Value("#{prop['exception.log.trace']}") - private boolean EXCEPTION_LOG_TRACE; + private boolean EXCEPTION_LOG_TRACE = true; //TODO : error 처리 - alert?? @Override diff --git a/src/main/java/cokr/xit/fims/framework/support/exception/resolver/NormalExceptionViewResolver.java b/src/main/java/cokr/xit/fims/framework/support/exception/resolver/NormalExceptionViewResolver.java index 072c5164..4eb8e4ff 100644 --- a/src/main/java/cokr/xit/fims/framework/support/exception/resolver/NormalExceptionViewResolver.java +++ b/src/main/java/cokr/xit/fims/framework/support/exception/resolver/NormalExceptionViewResolver.java @@ -16,10 +16,10 @@ import java.util.Map; @Slf4j public class NormalExceptionViewResolver extends AbstractExceptionViewResolver { - @Value("#{prop['exception.log.trace']}") - private boolean EXCEPTION_LOG_TRACE; - //TODO : error 처리 - alert?? + private boolean EXCEPTION_LOG_TRACE = true; + + @Override public ModelAndView doResolveException(HttpServletRequest request, HttpServletResponse response, Object obj, String errorCode, Object[] errorArguments, Exception exception) { diff --git a/src/main/java/cokr/xit/fims/framework/support/freemaker/FreeMarkerConfig.java b/src/main/java/cokr/xit/fims/framework/support/freemaker/FreeMarkerConfig.java deleted file mode 100644 index ae43b564..00000000 --- a/src/main/java/cokr/xit/fims/framework/support/freemaker/FreeMarkerConfig.java +++ /dev/null @@ -1,63 +0,0 @@ -package cokr.xit.fims.framework.support.freemaker; - -import org.apache.tiles.TilesContainer; -import org.apache.tiles.evaluator.AttributeEvaluatorFactory; -import org.apache.tiles.extras.complete.CompleteAutoloadTilesContainerFactory; -import org.apache.tiles.extras.complete.CompleteAutoloadTilesInitializer; -import org.apache.tiles.factory.AbstractTilesContainerFactory; -import org.apache.tiles.request.ApplicationContext; -import org.apache.tiles.request.ApplicationResource; -import org.apache.tiles.request.freemarker.render.FreemarkerRendererBuilder; -import org.apache.tiles.request.render.BasicRendererFactory; -import org.springframework.context.annotation.Bean; -import org.springframework.web.servlet.view.tiles3.TilesConfigurer; - -import java.util.ArrayList; -import java.util.List; - -//@Configuration -public class FreeMarkerConfig{ - - @Bean - public TilesConfigurer tilesConfigurer() { - - String tilesDefinitionPath = "classpath*:/WEB-INF/freemarker/layout-definition/tiles-layout.xml"; - - TilesConfigurer tilesConfigurer = new TilesConfigurer(); - tilesConfigurer.setTilesInitializer(new CompleteAutoloadTilesInitializer() { - @Override - protected AbstractTilesContainerFactory createContainerFactory(ApplicationContext context) { - // BasicTilesContainerFactory - return new CompleteAutoloadTilesContainerFactory() { - @Override - protected List getSources(ApplicationContext applicationContext) { - List retValue = new ArrayList(1); - retValue.add(applicationContext.getResource(tilesDefinitionPath)); - return retValue; - } - - @Override - protected void registerAttributeRenderers(BasicRendererFactory rendererFactory, ApplicationContext applicationContext, TilesContainer container, AttributeEvaluatorFactory attributeEvaluatorFactory) { - super.registerAttributeRenderers(rendererFactory, applicationContext, container, attributeEvaluatorFactory); - FreemarkerRendererBuilder freemarkerRenderer = FreemarkerRendererBuilder.createInstance(); - freemarkerRenderer.setApplicationContext(applicationContext); - freemarkerRenderer.setParameter("defaultEncoding", "UTF-8"); - //freemarkerRenderer.setParameter("ClasspathTlds", "/META-INF/tld/tiles-jsp.tld, /META-INF/spring.tld"); - //freemarkerRenderer.setParameter("autoInclude", "/WEB-INF/freemarker/common/common.ftl"); - freemarkerRenderer.setParameter("NoCache", "true"); - rendererFactory.registerRenderer("freemarker", freemarkerRenderer.build()); - } - }; - } - }); - return tilesConfigurer; - } - - // @Bean - // public UrlBasedViewResolver tilesViewResolver() { - // UrlBasedViewResolver urlBasedViewResolver = new UrlBasedViewResolver(); - // urlBasedViewResolver.setViewClass(TilesView.class); - // urlBasedViewResolver.setRequestContextAttribute("rc"); - // return urlBasedViewResolver; - // } -} diff --git a/src/main/java/cokr/xit/fims/framework/support/logback/LogbackMaskingPatternLayout.java b/src/main/java/cokr/xit/fims/framework/support/logback/LogbackMaskingPatternLayout.java deleted file mode 100644 index 1773aec1..00000000 --- a/src/main/java/cokr/xit/fims/framework/support/logback/LogbackMaskingPatternLayout.java +++ /dev/null @@ -1,59 +0,0 @@ -package cokr.xit.fims.framework.support.logback; - -import ch.qos.logback.classic.PatternLayout; -import ch.qos.logback.classic.spi.ILoggingEvent; - -import java.util.ArrayList; -import java.util.List; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import java.util.stream.Collectors; -import java.util.stream.IntStream; - -/** - * logback log masking - *

- * - * - * - * \"SSN\"\s*:\s*\"(.*?)\" - * \"address\"\s*:\s*\"(.*?)\" - * (\d+\.\d+\.\d+\.\d+) - * (\w+@\w+\.\w+) - * %-5p [%d{ISO8601,UTC}] [%thread] %c: %m%n%rootException - * - * - * - * - */ -public class LogbackMaskingPatternLayout extends PatternLayout { - - private Pattern multilinePattern; - private List maskPatterns = new ArrayList<>(); - - public void addMaskPattern(String maskPattern) { - maskPatterns.add(maskPattern); - multilinePattern = Pattern.compile(maskPatterns.stream().collect(Collectors.joining("|")), Pattern.MULTILINE); - } - - @Override - public String doLayout(ILoggingEvent event) { - return maskMessage(super.doLayout(event)); - } - - private String maskMessage(String message) { - if (multilinePattern == null) { - return message; - } - StringBuilder sb = new StringBuilder(message); - Matcher matcher = multilinePattern.matcher(sb); - while (matcher.find()) { - IntStream.rangeClosed(1, matcher.groupCount()).forEach(group -> { - if (matcher.group(group) != null) { - IntStream.range(matcher.start(group), matcher.end(group)).forEach(i -> sb.setCharAt(i, '*')); - } - }); - } - return sb.toString(); - } -} diff --git a/src/main/java/cokr/xit/fims/framework/support/mybatis/MybatisLanguageDriver.java b/src/main/java/cokr/xit/fims/framework/support/mybatis/MybatisLanguageDriver.java deleted file mode 100644 index a90bb213..00000000 --- a/src/main/java/cokr/xit/fims/framework/support/mybatis/MybatisLanguageDriver.java +++ /dev/null @@ -1,77 +0,0 @@ -package cokr.xit.fims.framework.support.mybatis; - -import lombok.SneakyThrows; -import lombok.extern.slf4j.Slf4j; -import org.apache.ibatis.executor.parameter.ParameterHandler; -import org.apache.ibatis.mapping.BoundSql; -import org.apache.ibatis.mapping.MappedStatement; -import org.apache.ibatis.mapping.ParameterMapping; -import org.apache.ibatis.mapping.SqlSource; -import org.apache.ibatis.parsing.XNode; -import org.apache.ibatis.scripting.xmltags.XMLLanguageDriver; -import org.apache.ibatis.session.Configuration; - -import java.lang.reflect.Field; -import java.util.List; - -/** - *

- * Mybatis sql logging
- * mybatis.configuration.default-scripting-language=com.xit.core.support.mybatis.MybatisLanguageDriver
- * 
- */ -@Slf4j -public class MybatisLanguageDriver extends XMLLanguageDriver { - public MybatisLanguageDriver() { - } - - @Override - public ParameterHandler createParameterHandler(MappedStatement mappedStatement, Object parameterObject, BoundSql boundSql) { - addDebuggingComment(boundSql); - return super.createParameterHandler(mappedStatement, parameterObject, boundSql); - } - - @Override - public SqlSource createSqlSource(Configuration configuration, XNode script, Class parameterType) { - return super.createSqlSource(configuration, script, parameterType); - } - - @Override - public SqlSource createSqlSource(Configuration configuration, String script, Class parameterType) { - return super.createSqlSource(configuration, script, parameterType); - } - - @SneakyThrows - private void addDebuggingComment(BoundSql boundSql) { - Field sqlField = BoundSql.class.getDeclaredField("sql"); - sqlField.setAccessible(true); - - String sql = (String) sqlField.get(boundSql); - List parameterMappings = boundSql.getParameterMappings(); - sql = addParameterComment(sql, parameterMappings); - - sqlField.set(boundSql, sql); - } - - private String addParameterComment(String sql, List parameters) { - StringBuilder sqlInternalStringBuilder = new StringBuilder(sql); - - int paramReverseIndex = parameters.size() - 1; - for (int idx = sql.length() - 1; idx > 0; idx--) { - char c = sql.charAt(idx); - if (c == '?') { - String commentedString = toCommentString(parameters.get(paramReverseIndex).getProperty()); - - sqlInternalStringBuilder.insert(idx + 1, commentedString); - paramReverseIndex = paramReverseIndex - 1; - } - } - - return sqlInternalStringBuilder.toString(); - } - - private String toCommentString(String comment) { - return " /*" + comment + "*/ "; - } - -} diff --git a/src/main/java/cokr/xit/fims/framework/support/mybatis/PagingConstants.java b/src/main/java/cokr/xit/fims/framework/support/mybatis/PagingConstants.java index 0a1a7469..38f87be6 100644 --- a/src/main/java/cokr/xit/fims/framework/support/mybatis/PagingConstants.java +++ b/src/main/java/cokr/xit/fims/framework/support/mybatis/PagingConstants.java @@ -12,7 +12,7 @@ import java.nio.charset.StandardCharsets; public class PagingConstants { - public static final String KEY_OP_MODE = "spring.profiles.active"; + public static final String KEY_OP_MODE = "spring.config.activate.on-profile"; public static final String OP_MODE_DEFAULT = "local"; // RestTemplate 상수 diff --git a/src/main/java/cokr/xit/fims/framework/support/tag/code/CodeSelectBoxTag.java b/src/main/java/cokr/xit/fims/framework/support/tag/code/CodeSelectBoxTag.java index aea6766c..df7e47d5 100644 --- a/src/main/java/cokr/xit/fims/framework/support/tag/code/CodeSelectBoxTag.java +++ b/src/main/java/cokr/xit/fims/framework/support/tag/code/CodeSelectBoxTag.java @@ -60,24 +60,17 @@ public class CodeSelectBoxTag extends TagSupport { if(!this.display){ sb.append(" style='display:none'"); } - //sb.append(" display='").append(this.display).append("'>").append("\n"); + sb.append(" alt='").append(this.alt).append("'>").append("\n"); - //out.print(" - /** XitFrameUnitMapper.findLatestBbsList */ - /** 게시판 최신 게시글 목록 조회 */ - SELECT BBS_ID - ,NTT_ID - ,NTT_NO - ,NTT_SJ - ,NTT_CN - ,ANSWER_YN - ,PARNTS_SNTNC_NO - ,ANSWER_LC - ,SRT_ORD - ,RDCNT - ,USE_YN - ,NTCE_BEGIN_DE - ,NTCE_END_DE - ,NTCR_ID - ,NTCR_NM - ,PASSWD - ,ATCH_FILE_ID - ,REG_DT - ,RGTR - ,MDFCN_DT - ,MDFR - FROM XIT_BBS - WHERE 1=1 - AND BBS_ID = #{bbsId } - AND PARNTS_SNTNC_NO = #{parntsSntncNo} - AND USE_YN = #{useYn } - ORDER BY REG_DT DESC - + - /** XitBatchRegMngMapper.findList */ - /** 배치작업관리 목록 조회 */ - - - - - - - WHERE 1=1 - - ORDER BY A.BATCH_OPERT_ID ASC - - - - - - - - - - - - - - - - - diff --git a/src/main/resources/sql/mapper/framework/mng/batch/XitBatchResultMng-mysql-mapper.xml b/src/main/resources/sql/mapper/framework/mng/batch/XitBatchResultMng-mysql-mapper.xml deleted file mode 100644 index 0761858d..00000000 --- a/src/main/resources/sql/mapper/framework/mng/batch/XitBatchResultMng-mysql-mapper.xml +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - SELECT LIST.* FROM( - - - - ) LIST LIMIT #{firstIndex}, #{recordCountPerPage} - - - - - SELECT A.BATCH_RESULT_ID AS "batchResultId" - ,A.BATCH_SCHDUL_ID AS "batchSchdulId" - ,A.BATCH_OPERT_ID AS "batchOpertId" - ,B.BATCH_OPERT_NM AS "batchOpertNm" - ,B.BATCH_PROGRM AS "batchProgrm" - ,A.PARAMTR AS "paramtr" - ,A.STTUS AS "sttus" - ,C.CODE_VAL AS "sttusNm" - ,A.ERROR_INFO AS "errorInfo" - ,A.EXECUT_BEGIN_TM AS "executBeginTime" - ,A.EXECUT_END_TM AS "executEndTime" - ,A.RGTR AS "rgtr" - ,DATE_FORMAT(A.REG_DT, '%Y-%m-%d %H:%i:%s') AS "regDt" - ,A.MDFR AS "mdfr" - ,DATE_FORMAT(A.MDFCN_DT, '%Y-%m-%d %H:%i:%s') AS "mdfcnDt" - - - FROM COMTNBATCHRESULT A - INNER JOIN COMTNBATCHOPERT B ON A.BATCH_OPERT_ID = B.BATCH_OPERT_ID - INNER JOIN tb_cmn_code C ON A.STTUS = C.CODE AND C.GRP_ID = 'XIT076' - - - - AND A.STTUS = #{sttus} - - - AND SUBSTRING(A.EXECUT_BEGIN_TM,1, 8) >= #{searchKeywordFrom} - - - AND SUBSTRING(A.EXECUT_BEGIN_TM,1, 8) <= #{searchKeywordTo} - - - - AND B.BATCH_OPERT_NM LIKE CONCAT('%',#{searchKeyword},'%') - - - AND B.BATCH_SCHDUL_ID LIKE CONCAT('%',#{searchKeyword},'%') - - - - - - - - - - - - - - - - - - - - - diff --git a/src/main/resources/sql/mapper/framework/mng/batch/XitBatchScheduleMng-mysql-mapper.xml b/src/main/resources/sql/mapper/framework/mng/batch/XitBatchScheduleMng-mysql-mapper.xml deleted file mode 100644 index b2b32554..00000000 --- a/src/main/resources/sql/mapper/framework/mng/batch/XitBatchScheduleMng-mysql-mapper.xml +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - SELECT LIST.* FROM( - - - - ) LIST LIMIT #{firstIndex}, #{recordCountPerPage} - - - - - SELECT A.BATCH_SCHDUL_ID AS "batchSchdulId" - ,A.BATCH_OPERT_ID AS "batchOpertId" - ,A.EXECUT_CYCLE AS "executCycle" - ,C.CODE_VAL AS "executCycleNm" - ,A.EXECUT_SCHDUL_DE AS "executSchdulDe" - ,A.EXECUT_SCHDUL_HOUR AS "executSchdulHour" - ,A.EXECUT_SCHDUL_MNT AS "executSchdulMnt" - ,A.EXECUT_SCHDUL_SECND AS "executSchdulSecnd" - ,B.BATCH_OPERT_NM AS "batchOpertNm" - ,B.BATCH_PROGRM AS "batchProgrm" - ,B.PARAMTR AS "paramtr" - ,A.RGTR AS "rgtr" - ,DATE_FORMAT(A.REG_DT, '%Y-%m-%d %H:%i:%s') AS "regDt" - ,A.MDFR AS "mdfr" - ,DATE_FORMAT(A.MDFCN_DT, '%Y-%m-%d %H:%i:%s') AS "mdfcnDt" - - - - FROM COMTNBATCHSCHDUL A - INNER JOIN COMTNBATCHOPERT B ON A.BATCH_OPERT_ID = B.BATCH_OPERT_ID - INNER JOIN tb_cmn_code C ON A.EXECUT_CYCLE = C.CODE AND C.GRP_ID = 'XIT047' - - - - - AND B.BATCH_OPERT_NM LIKE CONCAT('%',#{searchKeyword},'%') - - - AND A.BATCH_PROGRM LIKE CONCAT('%',#{searchKeyword},'%') - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/main/webapp/WEB-INF/jsp/fims/framework/biz/cmm/anonymous/forms/UserForm.jsp b/src/main/webapp/WEB-INF/jsp/fims/framework/biz/cmm/anonymous/forms/UserForm.jsp index 03ed5710..4efec691 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/framework/biz/cmm/anonymous/forms/UserForm.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/framework/biz/cmm/anonymous/forms/UserForm.jsp @@ -18,7 +18,7 @@