설정 관련 파일 제거

main
이범준 1 year ago
parent 48ae03d0b9
commit 73d6771272

@ -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 추가

1018
pom.xml

File diff suppressed because it is too large Load Diff

@ -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<DataObject> urls = new RequestHandlerReader().read(requestHandlers);
return new ModelAndView("select-url")
.addObject("multiple", multiple)
.addObject("urls", toJson(urls));
}
}

@ -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 {
}

@ -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 {
}

@ -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 {}

@ -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 {
}

@ -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 {
}

@ -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<ManagedUser> {
}

@ -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;

@ -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<String,Object> 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<NtriDTO.PhotoSendRequest> dtoList){
return ResultResponse.of(service.sendCrackdownPhotoToNtri(dtoList));
return new ModelAndView("jsonView").addObject("result",service.sendCrackdownPhotoToNtri(dtoList));
}
}

@ -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;

@ -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;

@ -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;

@ -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<String,Object> 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))

@ -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<String,Object> 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));
}
}

@ -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<String,Object> 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())

@ -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<String,Object> 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));
}
}

@ -57,7 +57,6 @@ public interface CacheService {
List<Map<String, Object>> findLatestBbsList();
List<XitBasicBbsMngVO> findBaseBbsList(final Map<String, Object> paraMap);
void evictLatestBbsList();
void evictBaseBbsList();

@ -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<Map<String, Object>> findLatestBbsList() {
Map<String, Object> 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")

@ -67,13 +67,6 @@ public class CacheServiceUtils {
// ---------------------------------------------------------------------------------------------------------
// BBS
// ---------------------------------------------------------------------------------------------------------
public static List<Map<String,Object>> findLatestBbsList() {
return JBeanRegistry.getCacheService().findLatestBbsList();
}
public static List<XitBasicBbsMngVO> findBaseBbsList(final Map<String,Object> paraMap) {
return JBeanRegistry.getCacheService().findBaseBbsList(paraMap);
}

@ -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);

@ -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<T> 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);
}
}

@ -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 {
/**
* <pre> : </pre>
* @param xitRollingNotiVO
* @return List<XitBbsVO>
* @author:
* @date: 2020. 10. 14.
*/
public List<XitBbsVO> findLatestBbsList(XitRollingNotiVO xitRollingNotiVO);
public XitUserInfoVO findXitUserInfoByAccountInfo(XitUserInfoVO userUsrVO);
}

@ -97,7 +97,7 @@ public interface XitFrameUnitService {
* :
* :
* </pre>
* @param user_se
* @param jijache
* @param accountId ID
* @param name
* @param email
@ -154,7 +154,7 @@ public interface XitFrameUnitService {
* <pre> : ID
* - ID 1, 0 .
* </pre>
* @param id
* @param acconuntId
* @return int
* @author:
* @date: 2020. 4. 10.
@ -255,17 +255,7 @@ public interface XitFrameUnitService {
/**
* <pre> : </pre>
* @param isRequired (true: , false: )
* @return List<XitBbsVO>
* @author:
* @date: 2020. 10. 14.
*/
public List<XitBbsVO> findLatestBbsList(boolean isRequired);

@ -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;

@ -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<XitBbsVO> findLatestBbsList(boolean isRequired) {
List<XitBbsVO> result = xitRollingNotiVO.getList();
if (isRequired) {
// 무조건 조회
result = xitFrameUnitMapper.findLatestBbsList(xitRollingNotiVO);
} else {
// 목록 데이터가 없을 경우만 조회
if (XitCmmnUtil.isEmpty(result))
result = xitFrameUnitMapper.findLatestBbsList(xitRollingNotiVO);
}
return result;
}
/**
* <pre>

@ -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<String, Object> 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"

@ -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));
}

@ -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;
/**
* <pre> : </pre>

@ -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 {
/**
* <pre> : (//) .
* - default(Globals.Xit.JoinMembership.Sttus) .
* [ ]
* Globals.Xit.JoinMembership.Sttus.Gnr //일반회원
* Globals.Xit.JoinMembership.Sttus.Ent //기업회원
* Globals.Xit.JoinMembership.Sttus.Usr //업무사용자
* </pre>
* @param userSe
* @return String

@ -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;
/**
* <pre> : </pre>

@ -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 ="";
/**
*

@ -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 {
/**
* <pre> : DB </pre>
* @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<String, Object> 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<String, Object> resultMap = new HashMap<String, Object>();
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<LinkedHashMap<String, Object>> 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<String, Object> data = new HashMap<String, Object>();
data.put("contents", list); //[tui Grid] data-contents
Map<String, Integer> pagination = new HashMap<String, Integer>();
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;
}
/**
* <pre> : CUD </pre>
* @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<List<LinkedHashMap<String, Object>>> arrDataset = new ArrayList<List<LinkedHashMap<String,Object>>>();
//질의문 갯수만큼 loop
for(int i=0; i<jsonArr.size(); i++) {
if(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<LinkedHashMap<String, Object>> 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<String, Object> resultMap = new HashMap<String, Object>();
// 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;
}
/**
* <pre> : </pre>

@ -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<String,Object> 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<String,Object> paraMap) {
return ResultResponse.of(service.findAuthRoleGrantList(paraMap));
return new ModelAndView("jsonView").addObject("result",service.findAuthRoleGrantList(paraMap));
}
@PostMapping(name = "", value = "/saveAuthRoleGrantList")

@ -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<String,Object> 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")

@ -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<String,Object> 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")

@ -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<String,Object> 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;
}
}

@ -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<String,Object> 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")

@ -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;
}

@ -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;
}
}

@ -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;
}
}

@ -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;
}
}

@ -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;
}
}

@ -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;
}

@ -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<BatchSchdulDfk>
*/
public void makeExecutSchdul(List<XitBatchScheduleDayOfWeekVO> 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;
}
}

@ -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 {
/**
* <pre> : </pre>
* @param searchVO
* @return List<XitBatchRegMngVO>
* @author:
* @date: 2020. 4. 16.
*/
public List<XitBatchRegMngVO> findList(XitBatchRegMngSearchVO searchVO) throws SQLException;
/**
* <pre> : </pre>
* @param searchVO
* @return int
* @author:
* @date: 2020. 4. 16.
*/
public int findListTotCnt(XitBatchRegMngSearchVO searchVO) throws SQLException;
/**
* <pre> : </pre>
* @param vo
* @return XitBatchRegMngVO
* @author:
* @date: 2020. 4. 16.
*/
public XitBatchRegMngVO findView(XitBatchRegMngVO vo) throws SQLException;
}

@ -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 {
/**
* <pre> : </pre>
* @param searchVO
* @return List<XitBatchResultMngVO>
* @author:
* @date: 2020. 4. 16.
*/
public List<XitBatchResultMngVO> findList(XitBatchResultMngSearchVO searchVO) throws SQLException;
/**
* <pre> : </pre>
* @param searchVO
* @return int
* @author:
* @date: 2020. 4. 16.
*/
public int findListTotCnt(XitBatchResultMngSearchVO searchVO) throws SQLException;
/**
* <pre> : </pre>
* @param vo
* @return XitBatchResultMngVO
* @author:
* @date: 2020. 4. 16.
*/
public XitBatchResultMngVO findView(XitBatchResultMngVO vo) throws SQLException;
}

@ -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 {
/**
* <pre> : </pre>
* @param searchVO
* @return List<XitBatchScheduleMngVO>
* @author:
* @date: 2020. 4. 16.
*/
public List<XitBatchScheduleMngVO> findList(XitBatchScheduleMngSearchVO searchVO) throws SQLException;
/**
* <pre> : </pre>
* @param searchVO
* @return int
* @author:
* @date: 2020. 4. 16.
*/
public int findListTotCnt(XitBatchScheduleMngSearchVO searchVO) throws SQLException;
/**
* <pre> : </pre>
* @param vo
* @return XitBatchScheduleMngVO
* @author:
* @date: 2020. 4. 16.
*/
public XitBatchScheduleMngVO findView(XitBatchScheduleMngVO vo) throws SQLException;
/**
* <pre> : </pre>
* @param vo
* @return List&lt;XitBatchScheduleDayOfWeekVO&gt;
* @author:
* @date: 2020. 4. 16.
*/
public List<XitBatchScheduleDayOfWeekVO> findsBatchSchedule(XitBatchScheduleMngVO vo);
}

@ -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
* <pre>
* == (Modification Information) ==
*
*
* ------- -------- ---------------------------
* 2010-08-30
* 2017-02-06 (ES) - [CWE-253, CWE-440, CWE-756]
* </pre>
*/
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());
}
}
}

@ -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
* <pre>
* == (Modification Information) ==
*
*
* ------- -------- ---------------------------
* 2021.10.07
* </pre>
*/
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;
}
}

@ -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
* <pre>
* == (Modification Information) ==
*
*
* ------- -------- ---------------------------
* 2010.08.30
* </pre>
*/
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<XitBatchScheduleMngVO> targetList = null;
XitBatchScheduleMngSearchVO searchVO = new XitBatchScheduleMngSearchVO();
// 모니터링 대상 검색 조건 초기화
searchVO.setPageIndex(1);
searchVO.setFirstIndex(0);
searchVO.setRecordCountPerPage(RECORD_COUNT_PER_PAGE);
targetList = (List<XitBatchScheduleMngVO>) 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()));
}
}
}

@ -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
* <pre>
* == (Modification Information) ==
*
*
* ------- -------- ---------------------------
* 2010.08.30
* </pre>
*/
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;
}
}

@ -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 {
/**
* <pre> : </pre>
* @param searchVO
* @return List<XitBatchRegMngVO>
* @author:
* @date: 2020. 7. 13.
*/
public List<XitBatchRegMngVO> findList(XitBatchRegMngSearchVO searchVO);
/**
* <pre> : </pre>
* @param searchVO
* @return int
* @author:
* @date: 2020. 7. 13.
*/
public int findListTotCnt(XitBatchRegMngSearchVO searchVO);
/**
* <pre> : </pre>
* @param vo
* @return XitBatchRegMngVO
* @author:
* @date: 2020. 7. 13.
*/
public XitBatchRegMngVO findView(XitBatchRegMngVO vo);
/**
* <pre> : </pre>
* @param vo void
* @author:
* @date: 2020. 7. 13.
*/
public void addProc(XitBatchRegMngVO vo);
/**
* <pre> : </pre>
* @param vo void
* @author:
* @date: 2020. 7. 13.
*/
public void modifyProc(XitBatchRegMngVO vo);
/**
* <pre> : </pre>
* @param vo void
* @author:
* @date: 2020. 7. 13.
*/
public void removeProc(XitBatchRegMngVO vo);
/**
* <pre> : </pre>
* @param ids void
* @author:
* @date: 2020. 7. 13.
*/
public void removesProc(String ids);
}

@ -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 {
/**
* <pre> : </pre>
* @param searchVO
* @return List<XitBatchResultMngVO>
* @author:
* @date: 2020. 7. 13.
*/
public List<XitBatchResultMngVO> findList(XitBatchResultMngSearchVO searchVO);
/**
* <pre> : </pre>
* @param searchVO
* @return int
* @author:
* @date: 2020. 7. 13.
*/
public int findListTotCnt(XitBatchResultMngSearchVO searchVO);
/**
* <pre> : </pre>
* @param vo
* @return XitBatchResultMngVO
* @author:
* @date: 2020. 7. 13.
*/
public XitBatchResultMngVO findView(XitBatchResultMngVO vo);
/**
* <pre> : </pre>
* @param vo void
* @author:
* @date: 2020. 7. 13.
*/
public void addProc(XitBatchResultMngVO vo);
/**
* <pre> : </pre>
* @param vo void
* @author:
* @date: 2020. 7. 13.
*/
public void modifyProc(XitBatchResultMngVO vo);
/**
* <pre> : </pre>
* @param vo void
* @author:
* @date: 2020. 7. 13.
*/
public void removeProc(XitBatchResultMngVO vo);
/**
* <pre> : </pre>
* @param ids void
* @author:
* @date: 2020. 7. 13.
*/
public void removesProc(String ids);
}

@ -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 {
/**
* <pre> : </pre>
* @param searchVO
* @return List<XitBatchScheduleMngVO>
* @author:
* @date: 2020. 7. 13.
*/
public List<XitBatchScheduleMngVO> findList(XitBatchScheduleMngSearchVO searchVO);
/**
* <pre> : </pre>
* @param searchVO
* @return int
* @author:
* @date: 2020. 7. 13.
*/
public int findListTotCnt(XitBatchScheduleMngSearchVO searchVO);
/**
* <pre> : </pre>
* @param vo
* @return XitBatchScheduleMngVO
* @author:
* @date: 2020. 7. 13.
*/
public XitBatchScheduleMngVO findView(XitBatchScheduleMngVO vo);
/**
* <pre> : </pre>
* @param vo void
* @author:
* @date: 2020. 7. 13.
*/
public void addProc(XitBatchScheduleMngVO vo);
/**
* <pre> : </pre>
* @param vo void
* @author:
* @date: 2020. 7. 13.
*/
public void modifyProc(XitBatchScheduleMngVO vo);
/**
* <pre> : </pre>
* @param vo void
* @author:
* @date: 2020. 7. 13.
*/
public void removeProc(XitBatchScheduleMngVO vo);
/**
* <pre> : </pre>
* @param ids void
* @author:
* @date: 2020. 7. 13.
*/
public void removesProc(String ids);
/**
* <pre> : </pre>
* @param ids void
* @author:
* @date: 2020. 7. 13.
*/
public void addBatchResult(XitBatchResultMngVO vo);
/**
* <pre> : </pre>
* @param ids void
* @author:
* @date: 2020. 7. 13.
*/
public void modifyBatchResult(XitBatchResultMngVO vo);
}

@ -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<XitBatchRegMngVO> findList(XitBatchRegMngSearchVO searchVO) {
List<XitBatchRegMngVO> 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<primaryKey.length;i++) {
XitBatchRegMngVO vo = new XitBatchRegMngVO();
vo.setBatchOpertId(primaryKey[i]);
this.removeProc(vo);
}
}
/**
* <pre>
* : VO CRUD Service VO .
* </pre>
*
* @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;
}
}

@ -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<XitBatchResultMngVO> findList(XitBatchResultMngSearchVO searchVO) {
List<XitBatchResultMngVO> 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<primaryKey.length;i++) {
XitBatchResultMngVO vo = new XitBatchResultMngVO();
vo.setBatchResultId(primaryKey[i]);
this.removeProc(vo);
}
}
/**
* <pre>
* : VO CRUD Service VO .
* </pre>
*
* @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;
}
}

@ -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<XitBatchScheduleMngVO> findList(XitBatchScheduleMngSearchVO searchVO) {
List<XitBatchScheduleMngVO> 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<XitBatchScheduleDayOfWeekVO> 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<XitBatchScheduleDayOfWeekVO> 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<primaryKey.length;i++) {
XitBatchScheduleMngVO vo = new XitBatchScheduleMngVO();
vo.setBatchSchdulId(primaryKey[i]);
this.removeProc(vo);
}
}
/**
* <pre>
* : VO CRUD Service VO .
* </pre>
*
* @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);
}
}

@ -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;
/**
*
* <ul>
* <li> : </li>
* <li> : .</li>
* <li>: 2021. 10. 7. 5:16:43
* </ul>
*
* @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<Map<String, String>> getCodeList(){
List<Map<String, String>> list = new ArrayList<Map<String, String>>();
for(BatchOpertSe value : BatchOpertSe.values()) {
Map<String, String> mCode = new HashMap<String, String>();
mCode.put("code", value.getCode());
mCode.put("codeVal", value.getCodeVal());
list.add(mCode);
}
return list;
}
}

@ -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
* <pre>
* == (Modification Information) ==
*
*
* ------- -------- ---------------------------
* 2010.08.20
* </pre>
*/
@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;
}
}

@ -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;
/**
* <pre> : </pre>
* @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";
}
/**
* <pre> : </pre>
* @return String
* @author:
* @date: 2020. 7. 31.
*/
@RequestMapping(name = "", value = "batchRegMng_list.ajax", method={RequestMethod.GET, RequestMethod.POST})
@ResponseBody
public Map<String, Object> 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<String, Object> resultMap = new HashMap<String, Object>();
try {
/**
*
*/
List<XitBatchRegMngVO> 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<String, Object> data = new HashMap<String, Object>();
data.put("contents", resultList); //[tui Grid] data-contents
Map<String, Integer> pagination = new HashMap<String, Integer>();
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;
}
/**
* <pre> : .</pre>
* @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;
}
/**
* <pre> : .</pre>
* @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<XitBatchRegMngVO> resultList = (List<XitBatchRegMngVO>) 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();
}
/**
* <pre> : CUD </pre>
* @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<String, Object> resultMap = new HashMap<String, Object>();
resultMap.put("message", message);
XitCmmnUtil.forwardForAjaxRequest(request, response, resultMap);
}else { //submit 요청 시
XitCmmnUtil.forwardForSubmitRequest(request, response, sLocationUrl, model.asMap());
}
}
}

@ -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;
/**
* <pre> : </pre>
* @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";
}
/**
* <pre> : </pre>
* @return String
* @author:
* @date: 2020. 8. 04.
*/
@RequestMapping(name = "", value = "batchResultMng_list.ajax", method={RequestMethod.GET, RequestMethod.POST})
@ResponseBody
public Map<String, Object> 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<String, Object> resultMap = new HashMap<String, Object>();
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<String, Object> data = new HashMap<String, Object>();
data.put("contents", xitBatchResultMngService.findList(searchVO)); //[tui Grid] data-contents
Map<String, Integer> pagination = new HashMap<String, Integer>();
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;
}
/**
* <pre> : .</pre>
* @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;
}
/**
* <pre> : .</pre>
* @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();
}
/**
* <pre> : CUD </pre>
* @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<String, Object> resultMap = new HashMap<String, Object>();
resultMap.put("message", message);
XitCmmnUtil.forwardForAjaxRequest(request, response, resultMap);
}else { //submit 요청 시
XitCmmnUtil.forwardForSubmitRequest(request, response, sLocationUrl, model.asMap());
}
}
}

@ -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;
/**
* <pre> : </pre>
* @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";
}
/**
* <pre> : </pre>
* @return String
* @author:
* @date: 2020. 7. 31.
*/
@RequestMapping(name = "", value = "batchScheduleMng_list.ajax", method={RequestMethod.GET, RequestMethod.POST})
@ResponseBody
public Map<String, Object> 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<String, Object> resultMap = new HashMap<String, Object>();
try {
/**
*
*/
List<XitBatchScheduleMngVO> 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<String, Object> data = new HashMap<String, Object>();
data.put("contents", resultList); //[tui Grid] data-contents
Map<String, Integer> pagination = new HashMap<String, Integer>();
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;
}
/**
* <pre> : .</pre>
* @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;
}
/**
* <pre> : .</pre>
* @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();
}
/**
* <pre> : CUD </pre>
* @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<String, Object> resultMap = new HashMap<String, Object>();
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<XitCodeVO> executCycleList = xitFrameCodeService.findCmmnDetailCodes("XIT047");
model.addAttribute("executCycleList", executCycleList);
//요일구분코드목록을 코드정보로부터 조회
List<XitCodeVO> executSchdulDfkSeList = xitFrameCodeService.findCmmnDetailCodes("XIT074");
model.addAttribute("executSchdulDfkSeList", executSchdulDfkSeList);
// 실행스케줄 시, 분, 초 값 설정.
Map<String, String> executSchdulHourList = new LinkedHashMap<String, String>();
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<String, String> executSchdulMntList = new LinkedHashMap<String, String>();
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<String, String> executSchdulSecndList = new LinkedHashMap<String, String>();
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);
}
}

@ -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;

@ -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<String, Object> 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));
}
}

@ -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<String, Object> 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")

@ -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<String, Object> 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")

@ -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<String, Object> 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")

@ -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/";
/**
* <pre> : () </pre>
@ -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));
}
}
/*

@ -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";
/**
* <pre> : </pre>
* @return String

@ -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<XitZipCodeMngVO> findZipCodes(final Map<String, Object> paraMap, final RowBounds rowBounds);
<T> XitZipCodeMngVO findZipCode(T t);
void addZipCode(final XitZipCodeMngVO vo);
void modifyZipCode(final XitZipCodeMngVO vo);
void removeZipcode(final XitZipCodeMngVO vo);
void uploadZipCodeByExcel(final FileInputStream fis);
}

@ -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<XitZipCodeMngVO> findZipCodes(final Map<String, Object> paraMap, final RowBounds rowBounds) {
return mapper.selectZips(paraMap, rowBounds);
}
@Override
@Transactional(readOnly = true)
public <T> 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());
}
}
}

@ -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<String, Object> 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")

@ -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<String, Object> 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)

@ -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<String, Object> 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")

@ -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<String, Object> 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;
}
}

@ -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) {

@ -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<String,Object> paraMap) {
return ResultResponse.of(service.findRoleInfos(paraMap));
return new ModelAndView("jsonView").addObject("result",service.findRoleInfos(paraMap));
}
@PostMapping(name = "", value = "/saveMenuByRoleList")

@ -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<String,Object> 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")

@ -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<String,Object> paraMap) {
return ResultResponse.of(service.findPrograms(paraMap, MybatisUtils.getPagingInfo(paraMap)));
return new ModelAndView("jsonView").addObject("result",service.findPrograms(paraMap, MybatisUtils.getPagingInfo(paraMap)));
}
/**

@ -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<String, Object> paraMap) {
return ResultResponse.of(service.findUsers(paraMap, MybatisUtils.getPagingInfo(paraMap)));
return new ModelAndView("jsonView").addObject("result",service.findUsers(paraMap, MybatisUtils.getPagingInfo(paraMap)));
}

@ -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<T> 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);
}
}
}
/**
* <pre>
* return ModelAndView (Grid data)
* {
* result - true / false
* message
* data: {
* contents -
* pagination -
* }
* count - ( )
* }
* </pre>
* @param data
* @return
* @param <T>
*/
public static <T> ModelAndView of(T data){
ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
mav.addObject("result", true);
mav.addObject("message", SUCCESS_MESSAGE);
Map<String, Object> 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 <T> ModelAndView of(T data, String viewName){
ModelAndView mav = new ModelAndView(viewName);
mav.addObject("result", true);
mav.addObject("message", SUCCESS_MESSAGE);
Map<String, Object> 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 <T> 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> 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<String,Object> xmlMap = new HashMap<>();
// xmlMap.put("result", this);
// return xmlMap;
// }
//
// return mapper.convertValue(this, Map.class);
// }
}

@ -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<T> 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 <T> ResponseEntity<? extends IResponse> of(T data){
return ResponseEntity.ok().body(new ResultResponse2<>(data));
}
public static <T> ResponseEntity<? extends IResponse> of(String name, T data){
Map<String, T> map = new HashMap<>();
map.put(name, data);
return ResponseEntity.ok().body(new ResultResponse2<>(map));
}
public static <T> ResponseEntity<? extends IResponse> 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> 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<String,Object> xmlMap = new HashMap<>();
// xmlMap.put("result", this);
// return xmlMap;
// }
//
// return mapper.convertValue(this, Map.class);
// }
}

@ -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<XitBbsVO> list; //게시글 목록
private String bbsId; //게시판 id
private String parntsSntncNo; //부모 글 번호
private String useYn; //사용 여부
}

@ -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() {}

@ -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<ResponseMessage> getResMessages() {
List<ResponseMessage> 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<String> getConsumeContentTypes() {
Set<String> consumes = new HashSet<>();
consumes.add("application/x-www-form-urlencoded");
consumes.add("application/json;charset=UTF-8");
return consumes;
}
private Set<String> getProduceContentTypes() {
Set<String> 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<SecurityReference> defaultAuth() {
AuthorizationScope authorizationScope = new AuthorizationScope("global", "accessEveryThing");
AuthorizationScope[] authorizationScopes = new AuthorizationScope[1];
authorizationScopes[0] = authorizationScope;
return Arrays.asList(new SecurityReference("Authorization", authorizationScopes));
}
}

@ -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;
}
}

@ -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;
}
}

@ -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);
}
}

@ -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;
}
}

@ -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<String, String[]> 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<String, String[]> getParameterMap() {
return Collections.unmodifiableMap(params);
}
@Override
public Enumeration<String> 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));
}
}
}

@ -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

@ -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<String, Object> model, HttpServletRequest request,
HttpServletResponse response) throws Exception {
// TODO Auto-generated method stub
try {
Workbook workbook = new SXSSFWorkbook(1000);
Sheet sheet = workbook.createSheet();
List<Object> list = (List<Object>)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<jsonArray.length(); i++ ) {
Cell cell = row.createCell(i);
//data Get
String id_txt = jsonArray.getJSONObject(i).getString("name"); //컬럼
Object obj = null;
if(rowData instanceof Map) {
Map<String, Object> map = (Map<String, Object>) 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;
}
}
}

@ -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;
}
}

@ -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();
}
/**
* <pre> : Model key,value Json .
* ex) Model model = new HashMap<String, String>
* model.put("key1", "value1");
* model.put("key2", "value2");
* model.put("key3", "value3");
* -> {"key1":"value1","key2":"value2","key3":"value3"}
* </pre>
* @param model Model;
* @return String
* @author:
* @date: 2019. 12. 16.
*/
@SuppressWarnings("unchecked")
public static String convertJsonFmtStrFromModel(Model model) {
Map<String, Object> map = model.asMap();
JSONObject json = new JSONObject();
for (Map.Entry<String, Object> 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<String> 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();
}

@ -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;
/**
*
* <ul>
* <li> : </li>
* <li> : </li>
* <li>: 2018. 8. 29. 2:03:26
* </ul>
*
* @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();
}
}

@ -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;
}
}

@ -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";

@ -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;
/**
*
* <ul>
* <li> : SFTP </li>
* <li> : </li>
* <li>: 2019. 9. 30. 6:41:26
* </ul>
*
* @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;
}
/**
* <pre> : SFTP </pre>
* @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;
}
/**
* <pre> : SFTP </pre>
* void
* @author:
* @date: 2019. 9. 30.
*/
private void disconnect() {
if(session.isConnected()){
System.out.println("disconnecting...");
sftpChannel.disconnect();
channel.disconnect();
session.disconnect();
}
}
/**
* <pre> : </pre>
* @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();
}
}
/**
* <pre> : </pre>
* @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();
}
}
/**
* <pre> : </pre>
* @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<File> arrFile = new ArrayList<File>();
Vector<LsEntry> vector = sftpChannel.ls(remotePathName);
// LsEntrySelector selector = new lsen
// Vector<LsEntry> 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;
// }
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save