no message

main
이범준 1 year ago
parent 4752c88114
commit 8d292c89f9

@ -1,18 +0,0 @@
package cokr.xit.fims.framework.biz.cmm.dao;// package cokr.xit.fims.framework.biz.cmm.mapper;
//
// import java.util.Collection;
// import java.util.Optional;
//
// import org.egovframe.rte.psl.dataaccess.mapper.Mapper;
// import cokr.xit.fims.framework.biz.cmm.model.CmmFileDtlDTO;
//
// @Mapper
// public interface ICmmFileDtlMapper {
// Collection<? extends CmmFileDtlDTO> selectByFileMstId(String fileMstId);
//
// int insertCmmFileDtl(CmmFileDtlDTO cmmFileDtl);
//
// Optional<CmmFileDtlDTO> selectByFileMstIdAndOrgFileNmIgnoreCase(String fileMstId, String orgFileNm);
//
// int deleteCmmFileDtlById(CmmFileDtlDTO cmmFileDtl);
// }

@ -1,54 +0,0 @@
package cokr.xit.fims.framework.biz.cmm.dao;
import cokr.xit.fims.framework.biz.cmm.CmmFileDTO;
import org.egovframe.rte.psl.dataaccess.mapper.Mapper;
import java.util.List;
import java.util.Optional;
@SuppressWarnings("MybatisXMapperMethodInspection")
@Mapper
public interface CmmFileMapper {
//-------------------------------------------------------------
// CmmFileMaster
//-------------------------------------------------------------
CmmFileDTO.FileMst selectCmmFileMastr(final String fileMstId);
<T> Optional<String> selectFileMastrIdByInfTypeAndInfKey(final T t);
int insertCmmFileMastr(final CmmFileDTO.FileMst cmmFileMst);
int deleteCmmFileMastr(final String fileMastrId);
//-------------------------------------------------------------
// CmmFileDtl
//-------------------------------------------------------------
List<CmmFileDTO.FileDtl> selectFilesByFileMastrId(final String fileMastrId);
List<CmmFileDTO.FileDtl> selectCmmFileDetails(final String fileMstId);
int insertCmmFileDetail(final CmmFileDTO.FileDtl cmmFileDtl);
CmmFileDTO.FileDtl selectCmmFileDetail(final CmmFileDTO.FileDtl dto);
/**
* <pre>
* (infType) (infKey)
* ex) infType - EIF (:)
* infKey - 2022091609485096255243399 ( PK)
* @param t infType infKey Map DTO / VO
* @return List<CmmFileDtlDTO>
* </pre>
*/
<T> List<CmmFileDTO.FileDtl> selectFilesByInfTypeAndInfKey(final T t);
int deleteCmmFileDetail(final CmmFileDTO.FileDtl cmmFileDtl);
//-------------------------------------------------------------
// 시민신고 : NatlNewspaper
//-------------------------------------------------------------
List<CmmFileDTO.FileDtl> selectFilesByEsbInterfaces(final CmmFileDTO.FileMst dto);
}

@ -1,31 +0,0 @@
package cokr.xit.fims.framework.biz.cmm.dao;// package cokr.xit.fims.framework.biz.cmm.mapper;
//
// import java.util.Collection;
// import java.util.Optional;
//
// import org.egovframe.rte.psl.dataaccess.mapper.Mapper;
// import cokr.xit.fims.framework.biz.cmm.model.CmmFileDtlDTO;
// import cokr.xit.fims.framework.biz.cmm.model.CmmFileMstDTO;
//
// @Mapper
// public interface ICmmFileMstMapper {
// //-------------------------------------------------------------
// // CmmFileMaster
// //-------------------------------------------------------------
// Optional<CmmFileMstDTO> selectByFileMstId(final String fileMstId);
//
// int insertCmmFileMst(CmmFileMstDTO cmmFileMst);
//
//
//
// //-------------------------------------------------------------
// // CmmFileDtl
// //-------------------------------------------------------------
// //Collection<? extends CmmFileDtlDTO> selectByFileMstId(String fileMstId);
//
// int insertCmmFileDtl(CmmFileDtlDTO cmmFileDtl);
//
// Optional<CmmFileDtlDTO> selectByFileMstIdAndOrgFileNmIgnoreCase(String fileMstId, String orgFileNm);
//
// int deleteCmmFileDtlById(CmmFileDtlDTO cmmFileDtl);
// }

@ -22,42 +22,7 @@ public interface XitFrameCodeMapper {
/**
* <pre> : </pre>
* @param ctgrId
* @return List<Map<String,String>>
* @author:
* @date: 2020. 4. 8.
*/
public List<XitCodeVO> findClCodes(Map<String, String> m) throws SQLException;
/**
* <pre> : </pre>
* @return List<XitCodeVO>
* @author:
* @date: 2020. 4. 8.
*/
public List<XitCodeVO> findCmmnCodes(Map<String, String> m) throws SQLException;
/**
* <pre> : </pre>
* @return List<XitCodeVO>
* @author:
* @date: 2020. 4. 8.
*/
public List<XitCodeVO> findCmmnDetailCodes(Map<String, String> m) throws SQLException;
/**
* <pre> : </pre>
* @return List<XitCodeVO>
* @author:
* @date: 2020. 4. 8.
*/
public List<XitCodeVO> findOrgnztCodes(Map<String, String> m) throws SQLException;
/**
* <pre> : </pre>
* @return List<XitCodeVO>
* @author:
* @date: 2020. 4. 8.
*/
public List<XitCodeVO> findGroupCodes(Map<String, String> m) throws SQLException;
public String instCdToSggCd(String instCd) throws SQLException; public String instCdToSggCd(String instCd) throws SQLException;

@ -1,39 +0,0 @@
package cokr.xit.fims.framework.biz.cmm.dao;
import org.egovframe.rte.psl.dataaccess.mapper.Mapper;
import java.util.List;
import java.util.Map;
/**
*
* @: XIT Mapper
* @:
* @: 2020. 4. 10. 9:02:30
* @:
* @author ()
* @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
@Mapper
public interface XitFrameFileMapper {
/**
* <pre> : .</pre>
* @param m
* @return List<Map<String, String>>
* @author:
* @date: 2020. 5. 13.
*/
public List<Map<String, String>> findList(Map<String, String> m);
/**
* <pre> : .</pre>
* @param m
* @return Map<String, String>
* @author:
* @date: 2020. 5. 13.
*/
public Map<String, String> findView(Map<String, String> m);
}

@ -1,44 +0,0 @@
package cokr.xit.fims.framework.biz.cmm.service;
import cokr.xit.fims.framework.biz.cmm.CmmFileDTO;
import cokr.xit.fims.framework.core.utils.XitCmmnUtil;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
/**
* @author Lim, Jong Uk (minuk926)
* @since 2021-07-16
*/
public interface CmmFileService {
//-------------------------------------------------------------
// CmmFile
//-------------------------------------------------------------
CmmFileDTO.FileMst findFiles(final String fileMstId);
@SuppressWarnings("UnusedReturnValue")
CmmFileDTO.FileMst saveFiles(final CmmFileDTO.FileMst fileMstDTO, final List<MultipartFile> files);
List<CmmFileDTO.FileDtl> saveAddFileDtl(final CmmFileDTO.FileDtl dto, final List<MultipartFile> files,
final boolean isCheckExists);
<T> List<CmmFileDTO.FileDtl> findFilesByInfTypeAndInfKey(final T t);
void removeFile(final CmmFileDTO.FileDtl fileDtlDTO);
<T> void removeAllFiles(final T t);
//-------------------------------------------------------------
// 시민신고 : NatlNewspaper
//-------------------------------------------------------------
List<CmmFileDTO.FileDtl> findFilesByEsbInterfaces(final CmmFileDTO.FileMst fileMstDTO);
@SuppressWarnings("UnusedReturnValue")
CmmFileDTO.FileMst saveCtznStmtFiles(final CmmFileDTO.FileMst fileMstDTO, final List<MultipartFile> files, final CmmFileDTO.FileDtl pngFileDtlDto);
default String getUserUniqId(){
return XitCmmnUtil.getUserUniqId();
}
}

@ -1,77 +0,0 @@
package cokr.xit.fims.framework.biz.cmm.service;
import java.util.List;
import java.util.Map;
/**
*
* @: XIT Service
* @:
* @: 2020. 4. 10. 9:02:18
* @:
* @author ()
* @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
public interface XitFrameFileService {
/**
* <pre> : .</pre>
* @param atchFileId ID
* @return List<Map<String, String>>
* @author:
* @date: 2020. 5. 13.
*/
public List<Map<String, String>> findList(String atchFileId);
/**
* <pre> : .</pre>
* @param atchFileId ID
* @param isImageFile
* @return List<Map<String, String>>
* @author:
* @date: 2020. 5. 13.
*/
public List<Map<String, String>> findList(String atchFileId, boolean isImageFile);
/**
* <pre> : .</pre>
* @param atchFileId ID
* @param fileSn
* @return Map<String, String>
* @author:
* @date: 2020. 5. 13.
*/
public Map<String, String> findView(String atchFileId, String fileSn);
/**
* <pre> : </pre>
* @param vo void
* @author:
* @date: 2020. 5. 13.
*/
public void addProc(Map<String, String> m);
/**
* <pre> : </pre>
* @param vo void
* @author:
* @date: 2020. 5. 13.
*/
public void modifyProc(Map<String, String> m);
/**
* <pre> : </pre>
* @param vo void
* @author:
* @date: 2020. 5. 13.
*/
public void removeProc(Map<String, String> m);
/**
* <pre> : </pre>
* @param ids void
* @author:
* @date: 2020. 5. 13.
*/
public void removesProc(String ids);
}

@ -1,350 +0,0 @@
package cokr.xit.fims.framework.biz.cmm.service.bean;
import cokr.xit.foundation.component.AbstractServiceBean;
import cokr.xit.fims.biz.FimsConst;
import cokr.xit.fims.framework.biz.cmm.dao.CmmFileMapper;
import cokr.xit.fims.framework.biz.cmm.CmmFileDTO;
import cokr.xit.fims.framework.biz.cmm.service.CmmFileService;
import cokr.xit.fims.framework.support.exception.BizRuntimeException;
import cokr.xit.fims.framework.support.util.Checks;
import cokr.xit.fims.framework.support.util.CommUtils;
import cokr.xit.fims.framework.support.util.DateUtils;
import cokr.xit.fims.framework.support.util.constants.MessageKey;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert;
import org.springframework.util.StringUtils;
import org.springframework.web.multipart.MultipartFile;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
@Slf4j
@Service
@RequiredArgsConstructor
public class CmmFileServiceBean extends AbstractServiceBean implements CmmFileService {
private String uploadRoot = "/data/fims/upload";
private String allowExt ="";
/**
* kbyte
*/
private long maxSize = 2048;
private final CmmFileMapper mapper;
@Override
@Transactional(readOnly = true)
public CmmFileDTO.FileMst findFiles(final String fileMstId) {
Assert.notNull(fileMstId, "대상 파일[fileMstId]을 선택해 주세요.");
CmmFileDTO.FileMst cmmFileMst = mapper.selectCmmFileMastr(fileMstId);
if(cmmFileMst != null) cmmFileMst.getCmmFileDtls().addAll(mapper.selectFilesByFileMastrId(cmmFileMst.getFileMastrId()));
return cmmFileMst;
}
/**
*
* @param fileMstDTO
* @param files
* @return
*/
@Override
@Transactional
public CmmFileDTO.FileMst saveFiles(final CmmFileDTO.FileMst fileMstDTO, final List<MultipartFile> files) {
boolean isCheckExists = setCmmFileMst(fileMstDTO);
mapper.insertCmmFileMastr(fileMstDTO);
String makePath = makeUploadFilePath(fileMstDTO);
String fileUploadPath = this.uploadRoot + makePath;
File file = new File(fileUploadPath);
if(!file.exists()) file.mkdirs();
List<CmmFileDTO.FileDtl> cmmFileDtls = saveFileDtls(fileMstDTO, files, isCheckExists, makePath, fileUploadPath);
fileMstDTO.getCmmFileDtls().addAll(cmmFileDtls);
return fileMstDTO;
}
/**
* file
* @param dto
* @param files
* @param isCheckExists
* @return
*/
@Override
@Transactional
public List<CmmFileDTO.FileDtl> saveAddFileDtl(final CmmFileDTO.FileDtl dto, final List<MultipartFile> files,
boolean isCheckExists) {
List<CmmFileDTO.FileDtl> cmmFileDtls = new ArrayList<>();
for(MultipartFile mf : files){
if(!mf.isEmpty()) {
String orgFileName = "";
try {
orgFileName = StringUtils.cleanPath(Objects.requireNonNull(mf.getOriginalFilename()));
CmmFileDTO.FileDtl fileDtlDTO = CmmFileDTO.FileDtl.builder()
.fileMastrId(dto.getFileMastrId())
.fileId(CommUtils.getStringFromUUID())
.filePath(dto.getFilePath())
.mimeType(mf.getContentType())
.orginlFileNm(orgFileName)
.fileExtsn(orgFileName.substring(orgFileName.lastIndexOf(".") + 1).toLowerCase())
.fileSize(mf.getSize())
.rgtr(getUserUniqId())
.build();
if (StringUtils.hasText(allowExt) && !allowExt.contains(fileDtlDTO.getFileExtsn())) {
log.error("Not support extention :: {}", orgFileName);
//TODO : 에러처리
//return RestError.of(String.format("Not support extention :: %s", orgFileName));
throw BizRuntimeException.create(
MessageKey.CUSTOM_MSG, String.format("Not support extention :: %s", orgFileName));
}
if (fileDtlDTO.getFileSize() > (maxSize * 1024)) {
log.error("Over size :: {}[{}]", orgFileName, fileDtlDTO.getFileSize());
//TODO : 에러처리
//return RestError.of(String.format("Over size :: %s[%l]", orgFileName, cmmFileDtl.getFileSize()));
throw BizRuntimeException.create(
MessageKey.CUSTOM_MSG, String.format("Over size :: %s[%d]", orgFileName, fileDtlDTO.getFileSize()));
}
//동일파일 삭제후 정보 저장
if(isCheckExists) removeFileAndFileInfo(fileDtlDTO);
mapper.insertCmmFileDetail(fileDtlDTO);
// 파일 전송
mf.transferTo(new File(this.uploadRoot + dto.getFilePath() + "/" + fileDtlDTO.getFileId()));
cmmFileDtls.add(fileDtlDTO);
// inputStream을 가져와서
// copyOfLocation (저장위치)로 파일을 쓴다.
// copy의 옵션은 기존에 존재하면 REPLACE(대체한다), 오버라이딩 한다
//Files.copy(multipartFile.getInputStream(), copyOfLocation, StandardCopyOption.REPLACE_EXISTING);
}catch(IOException e){
String errMsg = String.format("File Upload Error :: %s", orgFileName);
//TODO : 에러처리
//return RestError.of(String.format("File Upload Error :: %s", orgFileName));
throw BizRuntimeException.create(
MessageKey.CUSTOM_MSG, String.format("File Upload Error :: %s", orgFileName));
}
}
}
return cmmFileDtls;
}
/**
*
* @param t
* @return
*/
@Override
@Transactional(readOnly = true)
public <T> List<CmmFileDTO.FileDtl> findFilesByInfTypeAndInfKey(final T t) {
return mapper.selectFilesByInfTypeAndInfKey(t);
}
@Override
@Transactional
public void removeFile(final CmmFileDTO.FileDtl dto) {
// 첨부파일 목록 조회 - 파일 마스터 ID로
List<CmmFileDTO.FileDtl> dtlList = mapper.selectFilesByFileMastrId(dto.getFileMastrId());
if(dtlList.size() == 0){
throw BizRuntimeException.create(MessageKey.CUSTOM_MSG, "파일정보오류[유효하지 않은 파일 정보]");
}
// 해당 파일 삭제
this.removeFileAndFileInfo(dto);
// 첨부파일이 1개 였으면 마스터 정보도 삭제
if(dtlList.size() == 1) mapper.deleteCmmFileMastr(dtlList.get(0).getFileMastrId());
}
@Override
@Transactional
public <T> void removeAllFiles(T t) {
// 첨부 파일 목록 조회 : 업무코드 와 업무키로
List<CmmFileDTO.FileDtl> dtlList = mapper.selectFilesByInfTypeAndInfKey(t);
if(dtlList.size() == 0){
throw BizRuntimeException.create(MessageKey.CUSTOM_MSG, "파일정보오류[유효하지 않은 파일 정보]");
}
// 첨부파일 삭제
dtlList.forEach(this::removeFileAndFileInfo);
// 파일 마스터 정보 삭제
mapper.deleteCmmFileMastr(dtlList.get(0).getFileMastrId());
}
/**
*
*
* @param dtlDto CmmFileDTO.FileDtl
*/
@Transactional
public void removeFileAndFileInfo(final CmmFileDTO.FileDtl dtlDto){
CmmFileDTO.FileDtl selectDTO = mapper.selectCmmFileDetail(dtlDto);
if(Checks.isNotEmpty(selectDTO)){
mapper.deleteCmmFileDetail(selectDTO);
new File(this.uploadRoot + selectDTO.getFilePath() + "/" + selectDTO.getFileId()).delete();
};
}
/**
* and
* @param fileMstDTO
* @param files
* @param isCheckExists
* @param makePath
* @param fileUploadPath
* @return
*/
@Transactional
public List<CmmFileDTO.FileDtl> saveFileDtls(CmmFileDTO.FileMst fileMstDTO, List<MultipartFile> files,
boolean isCheckExists, String makePath, String fileUploadPath) {
List<CmmFileDTO.FileDtl> cmmFileDtls = new ArrayList<>();
for(MultipartFile mf : files){
if(!mf.isEmpty()) {
String orgFileName = "";
try {
orgFileName = StringUtils.cleanPath(Objects.requireNonNull(mf.getOriginalFilename()));
CmmFileDTO.FileDtl fileDtlDTO = CmmFileDTO.FileDtl.builder()
.fileMastrId(fileMstDTO.getFileMastrId())
.fileId(CommUtils.getStringFromUUID())
.filePath(makePath)
.mimeType(mf.getContentType())
.orginlFileNm(orgFileName)
.fileExtsn(orgFileName.substring(orgFileName.lastIndexOf(".") + 1).toLowerCase())
.fileSize(mf.getSize())
.rgtr(getUserUniqId())
.build();
if (StringUtils.hasText(allowExt) && !allowExt.contains(fileDtlDTO.getFileExtsn())) {
log.error("Not support extention :: {}", orgFileName);
//TODO : 에러처리
//return RestError.of(String.format("Not support extention :: %s", orgFileName));
throw BizRuntimeException.create(
MessageKey.CUSTOM_MSG, String.format("Not support extention :: %s", orgFileName));
}
if (fileDtlDTO.getFileSize() > (maxSize * 1024)) {
log.error("Over size :: {}[{}]", orgFileName, fileDtlDTO.getFileSize());
//TODO : 에러처리
//return RestError.of(String.format("Over size :: %s[%l]", orgFileName, cmmFileDtl.getFileSize()));
throw BizRuntimeException.create(
MessageKey.CUSTOM_MSG, String.format("Over size :: %s[%d]", orgFileName, fileDtlDTO.getFileSize()));
}
//동일파일 삭제후 정보 저장
if(isCheckExists) removeFileAndFileInfo(fileDtlDTO);
mapper.insertCmmFileDetail(fileDtlDTO);
// 파일 전송
mf.transferTo(new File(fileUploadPath + "/" + fileDtlDTO.getFileId()));
cmmFileDtls.add(fileDtlDTO);
// inputStream을 가져와서
// copyOfLocation (저장위치)로 파일을 쓴다.
// copy의 옵션은 기존에 존재하면 REPLACE(대체한다), 오버라이딩 한다
//Files.copy(multipartFile.getInputStream(), copyOfLocation, StandardCopyOption.REPLACE_EXISTING);
}catch(IOException e){
String errMsg = String.format("File Upload Error :: %s", orgFileName);
//TODO : 에러처리
//return RestError.of(String.format("File Upload Error :: %s", orgFileName));
throw BizRuntimeException.create(
MessageKey.CUSTOM_MSG, String.format("File Upload Error :: %s", orgFileName));
}
}
}
return cmmFileDtls;
}
private static String makeUploadFilePath(CmmFileDTO.FileMst fileMstDTO) {
// 업로드 세부 경로 설정
String makePath = fileMstDTO.getUploadeJobPath();
String dateStr = DateUtils.getToday("");
String strDiv = fileMstDTO.getFileDirPath();
if(Checks.isNotEmpty(strDiv)){
if(Objects.equals(FimsConst.FileDirDepth.YEAR.getCode(), strDiv)) makePath = makePath + "/" + dateStr.substring(0, 4);
else if(Objects.equals(FimsConst.FileDirDepth.MONTH.getCode(), strDiv)) makePath = makePath + "/" + dateStr.substring(0, 6);
else makePath = makePath + "/" + dateStr.substring(0,4) + "/" + dateStr.substring(4);
}
return makePath;
}
private boolean setCmmFileMst(CmmFileDTO.FileMst fileMstDTO) {
Assert.notNull(fileMstDTO, "파일 정보가 존재하지 않습니다.");
Assert.notNull(fileMstDTO.getInfType(), "파일 구분 코드[fileCtgCd] 정보가 존재하지 않습니다.");
Assert.notNull(fileMstDTO.getInfKey(), "파일 업무 ID[fileBizId] 정보가 존재하지 않습니다.");
boolean isCheckExists = StringUtils.hasText(fileMstDTO.getFileMastrId());
String fileMstId = null;
// file Master key set
// file Master 생성
if(isCheckExists) fileMstId = fileMstDTO.getFileMastrId();
else fileMstId = CommUtils.getStringFromUUID();
fileMstDTO.setFileMastrId(fileMstId);
fileMstDTO.setRgtr(getUserUniqId());
return isCheckExists;
}
//-----------------------------------------------------------------------------------------------
// 시민신고 - 국민신문고 업무
//-----------------------------------------------------------------------------------------------
@Override
@Transactional(readOnly = true)
public List<CmmFileDTO.FileDtl> findFilesByEsbInterfaces(final CmmFileDTO.FileMst dto) {
return mapper.selectFilesByEsbInterfaces(dto);
}
/**
*
* + ,
* @param fileMstDTO
* @param files
* @param pngFileDtlDto
* @return
*/
@Override
@Transactional
public CmmFileDTO.FileMst saveCtznStmtFiles(final CmmFileDTO.FileMst fileMstDTO, final List<MultipartFile> files, final CmmFileDTO.FileDtl pngFileDtlDto) {
boolean isCheckExists = setCmmFileMst(fileMstDTO);
mapper.insertCmmFileMastr(fileMstDTO);
String makePath = makeUploadFilePath(fileMstDTO);
String fileUploadPath = this.uploadRoot + makePath;
File file = new File(fileUploadPath);
if(!file.exists()) file.mkdirs();
// 단속 이미지 저장
List<CmmFileDTO.FileDtl> cmmFileDtls = saveFileDtls(fileMstDTO, files, isCheckExists, makePath, fileUploadPath);
// 위도경도 png 이미지 저장
pngFileDtlDto.setFileMastrId(fileMstDTO.getFileMastrId());
//pngFileDtlDto.setFileId(CommUtils.getStringFromUUID());
mapper.insertCmmFileDetail(pngFileDtlDto);
cmmFileDtls.add(pngFileDtlDto);
fileMstDTO.getCmmFileDtls().addAll(cmmFileDtls);
return fileMstDTO;
}
}

@ -1,76 +0,0 @@
package cokr.xit.fims.framework.biz.cmm.service.bean;
import cokr.xit.foundation.component.AbstractServiceBean;
import cokr.xit.fims.framework.biz.cmm.dao.XitFrameFileMapper;
import cokr.xit.fims.framework.biz.cmm.XitFileDetailInfoVO;
import cokr.xit.fims.framework.biz.cmm.service.XitFrameCrudService;
import cokr.xit.fims.framework.biz.cmm.service.XitFrameFileService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
public class XitFrameFileServiceBean extends AbstractServiceBean implements XitFrameFileService {
@Resource
private XitFrameFileMapper xitFrameFileMapper;
@Resource
private XitFrameCrudService xitFrameCrudService;
@Override
public List<Map<String, String>> findList(String atchFileId) {
return this.findList(atchFileId, false);
}
@Override
public List<Map<String, String>> findList(String atchFileId, boolean isImageFile) {
Map<String, String> param = new HashMap<String, String>();
param.put("atchFileId", atchFileId);
param.put("isImageFile", isImageFile?"true":"false");
return xitFrameFileMapper.findList(param);
}
@Override
public Map<String, String> findView(String atchFileId, String fileSn) {
Map<String, String> m = new HashMap<String, String>();
m.put("atchFileId", atchFileId);
m.put("fileSn", fileSn);
return xitFrameFileMapper.findView(m);
}
@Override
public void addProc(Map<String, String> m) {
}
@Override
public void modifyProc(Map<String, String> m) {
}
@Override
public void removeProc(Map<String, String> m) {
/**
*
*/
XitFileDetailInfoVO vo = new XitFileDetailInfoVO();
vo.setAtchFileId(m.get("atchFileId"));
vo.setFileSn(m.get("fileSn"));
/**
*
*/
xitFrameCrudService.removeXitFileDetailInfo(vo);
}
@Override
public void removesProc(String ids) {
}
}

@ -1,173 +0,0 @@
package cokr.xit.fims.framework.biz.cmm.web;
import cokr.xit.foundation.web.AbstractController;
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.support.exception.BizRuntimeException;
import cokr.xit.fims.framework.support.exception.CustomBaseException;
import cokr.xit.fims.framework.support.util.AjaxMessageMapRenderer;
import cokr.xit.fims.framework.support.util.Checks;
import cokr.xit.fims.framework.support.util.constants.MessageKey;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.FileUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpHeaders;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Arrays;
@Slf4j
@Controller
@RequiredArgsConstructor
@RequestMapping(name = "", value = "/framework/biz/cmm/file")
public class CmmFileMgtController extends AbstractController {
private String uploadRoot = "/data/fims/upload";
private final CmmFileService cmmFileService;
@RequestMapping(name = "", value = "/cmmImageViewPopup")
public ModelAndView cmmImageViewPopup(final CmmFileDTO.FileDtl dto) {
ModelAndView mav = new ModelAndView(FrameworkConstants.FRAMEWORK_JSP_BASE_PATH + "cmm/file/cmmImageViewPopup.popup");
mav.addObject("fileDtlDTO", dto);
// mav.addObject("downloadUrl", downloadUrl);
return mav;
}
@RequestMapping(name = "", value = "/cmmPaintwebImageEditorPopup")
public ModelAndView cmmPaintwebImageEditorPopup(final String imageTagId) {
ModelAndView mav = new ModelAndView(FrameworkConstants.FRAMEWORK_JSP_BASE_PATH + "cmm/file/cmmPaintwebImageEditorPopup.popup");
mav.addObject("imageTagId", imageTagId);
return mav;
}
@PostMapping(name = "", value = "/uploadPaintweb")
public ModelAndView uploadPaintweb(final CmmFileDTO.PaintwebReq dto) {
log.debug("uploadPaintweb >>> {}", dto);
ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
CmmFileDTO.FileDtl cmmFileDtl = CmmFileDTO.FileDtl.builder()
.fileMastrId(dto.getFileMastrId())
.filePath(dto.getFilePath())
.orginlFileNm(dto.getOrginlFileNm())
.build();
cmmFileService.saveAddFileDtl(cmmFileDtl, Arrays.asList(dto.getFile()), false);
AjaxMessageMapRenderer.success(mav, MessageKey.CMM_INSERT_SUCCESS);
return mav;
}
@RequestMapping(name = "", value = "/download")
public void downloadFromVo(final CmmFileDTO.FileDtl fileDtlDTO, HttpServletResponse response) {
StringBuilder sb = new StringBuilder();
sb.append(uploadRoot)
.append(fileDtlDTO.getFilePath())
.append("/")
.append(fileDtlDTO.getFileId());
downloadExec(sb.toString(), fileDtlDTO.getOrginlFileNm(), response);
}
@RequestMapping(name = "", value = "/downloadFromFileFullPath")
public void downloadFromFileFullPath(final String fileFullPath, final String fileName, HttpServletResponse response) {
downloadExec(fileFullPath, fileName, response);
}
@RequestMapping(name = "", value = "/removeFile")
public ModelAndView removeFile(final CmmFileDTO.FileDtl fileDtlDTO) {
if(Checks.isEmpty(fileDtlDTO)) throw BizRuntimeException.create(MessageKey.CUSTOM_MSG, "파일 정보가 존재하지 않습니다.");
if(Checks.isEmpty(fileDtlDTO.getFileMastrId())) throw BizRuntimeException.create(MessageKey.CUSTOM_MSG, "파일마스터ID 정보가 존재하지 않습니다.");
if(Checks.isEmpty(fileDtlDTO.getFileId())) throw BizRuntimeException.create(MessageKey.CUSTOM_MSG, "파일ID 정보가 존재하지 않습니다.");
ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
cmmFileService.removeFile(fileDtlDTO);
AjaxMessageMapRenderer.success(mav, MessageKey.CMM_DELETE_SUCCESS);
return mav;
}
@RequestMapping(name = "", value = "/removeAllFiles")
public ModelAndView removeAllFiles(final CmmFileDTO.FileMst fileMstDTO) {
if(Checks.isEmpty(fileMstDTO)) throw BizRuntimeException.create(MessageKey.CUSTOM_MSG, "파일 정보가 존재하지 않습니다.");
if(Checks.isEmpty(fileMstDTO.getInfType())) throw BizRuntimeException.create(MessageKey.CUSTOM_MSG, "파일구분 정보가 존재하지 않습니다.");
if(Checks.isEmpty(fileMstDTO.getInfKey())) throw BizRuntimeException.create(MessageKey.CUSTOM_MSG, "파일업무ID 정보가 존재하지 않습니다.");
ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
cmmFileService.removeAllFiles(fileMstDTO);
AjaxMessageMapRenderer.success(mav, MessageKey.CMM_DELETE_SUCCESS);
return mav;
}
private void downloadExec(String absFile, String fileName, HttpServletResponse response) {
Path path = Paths.get(absFile);
String contentType = null;
long fileSize = 0L;
try {
contentType = Files.probeContentType(path);
fileSize = Files.size(path);
} catch (IOException e) {
//throw new CustomBaseException(ErrorCode.FILE_NOT_FOUND);
contentType = "application/octet-stream";
//fileName = "FileNotFound";
}
File file = new File(absFile);
byte[] fileByte = new byte[0];
try {
fileByte = FileUtils.readFileToByteArray(file);
} catch (IOException e) {
fileByte = new byte[0];
//throw new CustomBaseException(ErrorCode.FILE_NOT_FOUND);
}
response.setHeader(HttpHeaders.CONTENT_TYPE, contentType);
response.setHeader(HttpHeaders.ACCESS_CONTROL_ALLOW_CREDENTIALS, "true");
response.setHeader("Pragma", "no-cache");
response.setHeader(HttpHeaders.CACHE_CONTROL, "no-cache, must-revalidate");
response.setDateHeader(HttpHeaders.EXPIRES, 0);
try {
response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + URLEncoder.encode(fileName,
String.valueOf(StandardCharsets.UTF_8)) + "\";");
} catch (UnsupportedEncodingException e) {
throw BizRuntimeException.create(MessageKey.CUSTOM_MSG, e.getMessage());
}
response.setHeader(HttpHeaders.CONTENT_LENGTH, String.valueOf(fileSize));
response.setContentType(contentType);
//response.setHeader(HttpHeaders.CONTENT_ENCODING, "binary");
try {
response.getOutputStream().write(fileByte);
response.getOutputStream().flush();
response.getOutputStream().close();
} catch (IOException e) {
throw new CustomBaseException(ErrorCode.FILE_NOT_FOUND);
}
}
@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 new ModelAndView("jsonView").addObject("result",cmmFileService.findFiles(fileMstId));
}
}

@ -1,87 +0,0 @@
package cokr.xit.fims.framework.biz.cmm.web;
import cokr.xit.foundation.web.AbstractController;
import cokr.xit.fims.framework.biz.cmm.service.XitFramePopupService;
import cokr.xit.fims.framework.core.constants.FrameworkConstants;
import cokr.xit.fims.framework.core.XitBaseSearchVO;
import org.egovframe.rte.ptl.mvc.tags.ui.pagination.PaginationInfo;
import org.springframework.context.support.ReloadableResourceBundleMessageSource;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import javax.annotation.Resource;
/**
*
* @: XIT Controller
* @:
* @author ()
* @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
@Controller
@RequestMapping(name = "", value = "/framework/biz/cmm")
public class FrameworkCmmController extends AbstractController {
@Resource
private XitFramePopupService xitFramePopupService;
@Resource
private cokr.xit.fims.framework.biz.cmm.service.XitFrameUnitService XitFrameUnitService;
private int PAGE_UNIT = 10;
private int PAGE_SIZE = 10;
/**
* <pre> : </pre>
* @return String
* @author:
* @date: 2020. 4. 10.
*/
@GetMapping(name = "", value="/popup/ZipSearch")
public String ZipSearch() {
return FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"cmm/popup/XitZipSearch";
}
/**
* <pre> : </pre>
* @param modelMap
* @return String
* @author:
* @date: 2020. 4. 10.
*/
@GetMapping(name = "", value="/popup/ZipSearchList")
public String ZipSearchList(@ModelAttribute("searchVO") XitBaseSearchVO searchVO , ModelMap modelMap) {
searchVO.setPageUnit(PAGE_UNIT);
searchVO.setPageSize(PAGE_SIZE);
/** pageing */
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());
modelMap.addAttribute("resultList", xitFramePopupService.findListZip(searchVO));
int totCnt = xitFramePopupService.findListZipTotCnt(searchVO);
paginationInfo.setTotalRecordCount(totCnt);
modelMap.addAttribute("paginationInfo", paginationInfo);
return FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"cmm/popup/XitZipSearchList";
}
}

@ -1,457 +0,0 @@
package cokr.xit.fims.framework.biz.cmm.web;
import cokr.xit.foundation.web.AbstractController;
import cokr.xit.fims.framework.biz.cmm.service.XitFrameFileService;
import cokr.xit.fims.framework.core.BaseVO;
import cokr.xit.fims.framework.core.XitBaseSearchVO;
import org.springframework.context.support.ReloadableResourceBundleMessageSource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.ui.ModelMap;
import org.springframework.util.FileCopyUtils;
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.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.net.URLEncoder;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
*
* @: XIT Controller
* @:
* @author ()
* @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
@Controller
@RequestMapping(name = "", value = "/_cmmn_/file/")
public class XitFrameFileController extends AbstractController {
private static final Logger logger = LoggerFactory.getLogger(XitFrameFileController.class);
@Resource
private XitFrameFileService xitFrameFileService;
@Resource
private cokr.xit.fims.framework.biz.cmm.service.XitFrameUnitService XitFrameUnitService;
/**
* <pre> : </pre>
* @param searchVO
* @param modelMap
* @return String
* @author:
* @date: 2020. 5. 13.
*/
@RequestMapping(name = "", value="AttachFile_list", method={RequestMethod.GET, RequestMethod.POST})
public String AttachFile_list(@ModelAttribute("searchVO") XitBaseSearchVO searchVO , ModelMap modelMap
,@RequestParam(value="atchFileId", required=false, defaultValue="") String atchFileId
) {
List<Map<String, String>> result = xitFrameFileService.findList(atchFileId);
modelMap.addAttribute("fileList", result);
modelMap.addAttribute("updateFlag", "N");
modelMap.addAttribute("fileListCnt", result.size());
modelMap.addAttribute("atchFileId", atchFileId);
return "framework/biz/common/file/XitAttachFile_list";
}
/**
* <pre> : </pre>
* @param searchVO
* @param modelMap
* @return String
* @author:
* @date: 2020. 5. 13.
*/
@RequestMapping(name = "", value="AttachFile_image_list", method={RequestMethod.GET, RequestMethod.POST})
public String AttachFile_image_list(@ModelAttribute("searchVO") XitBaseSearchVO searchVO , ModelMap modelMap
,@RequestParam(value="atchFileId", required=false, defaultValue="") String atchFileId
) {
List<Map<String, String>> result = xitFrameFileService.findList(atchFileId, true);
modelMap.addAttribute("fileList", result);
modelMap.addAttribute("updateFlag", "N");
modelMap.addAttribute("fileListCnt", result.size());
modelMap.addAttribute("atchFileId", atchFileId);
return "framework/biz/common/file/XitAttachFile_imgage_list";
}
/**
* <pre> : .</pre>
* @param page
* @param model
* @return String
* @author:
* @date: 2020. 5. 13.
*/
@RequestMapping(name = "", value = "AttachFile_{cmd}", method={RequestMethod.GET, RequestMethod.POST})
public String AttachFile_page(@PathVariable String cmd
, @ModelAttribute("vo") BaseVO vo
, @ModelAttribute("searchVO") XitBaseSearchVO searchVO
, ModelMap model
,@RequestParam(value="atchFileId", required=false, defaultValue="") String atchFileId
) {
String returnUrl = "kr/xit/framework/biz/cmm/file/XitAttachFile_" +cmd;
List<Map<String, String>> result = null;
switch (cmd) {
case "edit": //수정 페이지
result = xitFrameFileService.findList(atchFileId);
model.addAttribute("fileList", result);
model.addAttribute("updateFlag", "Y");
model.addAttribute("fileListCnt", result.size());
model.addAttribute("atchFileId", atchFileId);
returnUrl = "kr/xit/framework/biz/cmm/file/XitAttachFile_list" ;
break;
default:
throw new RuntimeException("유효하지 않은 요청 입니다.");
}
return returnUrl;
}
/**
* <pre> : .</pre>
* @param page
* @param model
* @return String
* @author:
* @date: 2020. 5. 13.
*/
@RequestMapping(name = "", value = "AttachFile_{cmd}_popup", method={RequestMethod.GET, RequestMethod.POST})
public String AttachFile_page_popup(@PathVariable String cmd
, @ModelAttribute XitBaseSearchVO searchVO
, @ModelAttribute BaseVO vo, ModelMap model) {
switch (cmd) {
case "": //
break;
default:
throw new RuntimeException("유효하지 않은 요청 입니다.");
}
return "framework/biz/common/file/XitAttachFile_"+cmd+"_popup";
}
/**
* <pre> : CUD </pre>
* @return String
* @author:
* @date: 2020. 5. 13.
*/
@RequestMapping(name = "", value = "AttachFile_{cmd}_proc", method=RequestMethod.POST)
public String AttachFile_cmd_proc(HttpServletRequest req
,@PathVariable String cmd
,@ModelAttribute("vo") BaseVO vo
,@ModelAttribute("searchVO") XitBaseSearchVO searchVO
,@RequestParam(value="atchFileId", required=false, defaultValue="") String atchFileId
,@RequestParam(value="fileSn", required=false, defaultValue="") String fileSn
,@RequestParam(value="fileIds", required=false, defaultValue="") String fileIds
,@RequestParam("returnUrl") String returnUrl
,BindingResult bindingResult
,SessionStatus status
,Model model
) {
/**
*
*/
String message = null;
Map<String, String> m = new HashMap<String, String>();
switch (cmd) {
// case "insert": //등록
// break;
//
// case "inserts": //다건 등록
// break;
//
// case "update": //수정
// break;
case "delete": //삭제
m.put("atchFileId", atchFileId);
m.put("fileSn", fileSn);
xitFrameFileService.removeProc(m);
break;
// case "deletes": //다건 삭제
// break;
default:
new RuntimeException("유효하지 않은 요청 입니다.");
}
/**
*
*/
model.addAttribute("message", message);
if ("".equals(req.getContextPath()) || "/".equals(req.getContextPath())) {
return "forward:" + returnUrl;
}
if (returnUrl.startsWith(req.getContextPath())) {
return "forward:" + returnUrl.substring(returnUrl.indexOf("/", 1));
} else {
return "forward:" + returnUrl;
}
}
@RequestMapping(name = "", value = "Download", method={RequestMethod.GET, RequestMethod.POST})
public void cvlcptFileDownload(@RequestParam Map<String, Object> commandMap, HttpServletRequest request, HttpServletResponse response) throws Exception {
/**
*
*/
String atchFileId = (String) commandMap.get("atchFileId");
String fileSn = (String) commandMap.get("fileSn");
Map<String, String> result = xitFrameFileService.findView(atchFileId, fileSn);
/**
*
*/
//파일 Read
File uFile = new File(result.get("fileStreCours"), result.get("streFileNm"));
long fSize = uFile.length();
//파일사이즈에 따라 처리 분기
if (fSize > 0) {
String mimetype = "application/x-msdownload";
response.setContentType(mimetype);
setDisposition(result.get("orignlFileNm"), request, response);
//response.setContentLength(fSize);
BufferedInputStream in = null;
BufferedOutputStream out = null;
try {
in = new BufferedInputStream(new FileInputStream(uFile));
out = new BufferedOutputStream(response.getOutputStream());
FileCopyUtils.copy(in, out);
out.flush();
} catch (Exception ex) {
logger.debug("IGNORED: {}", ex.getMessage());
} finally {
if (in != null) {
try {
in.close();
} catch (Exception ignore) {
logger.debug("IGNORED: {}", ignore.getMessage());
}
}
if (out != null) {
try {
out.close();
} catch (Exception ignore) {
logger.debug("IGNORED: {}", ignore.getMessage());
}
}
}
} else {
response.setContentType("application/x-msdownload");
PrintWriter printwriter = response.getWriter();
printwriter.println("<html>");
printwriter.println("<br><br><br><h2>Could not get file name:<br>" + result.get("orignlFileNm") + "</h2>");
printwriter.println("<br><br><br><center><h3><a href='javascript: history.go(-1)'>Back</a></h3></center>");
printwriter.println("<br><br><br>&copy; webAccess");
printwriter.println("</html>");
printwriter.flush();
printwriter.close();
}
}
/**
* .
*
* @param request
* @return
*/
private String getBrowser(HttpServletRequest request) {
String header = request.getHeader("User-Agent");
if (header.indexOf("MSIE") > -1) {
return "MSIE";
} else if (header.indexOf("Trident") > -1) { // IE11 문자열 깨짐 방지
return "Trident";
} else if (header.indexOf("Chrome") > -1) {
return "Chrome";
} else if (header.indexOf("Opera") > -1) {
return "Opera";
}
return "Firefox";
}
/**
* Disposition .
*
* @param filename
* @param request
* @param response
* @throws Exception
*/
private void setDisposition(String filename, HttpServletRequest request, HttpServletResponse response) throws Exception {
String browser = getBrowser(request);
String dispositionPrefix = "attachment; filename=";
String encodedFilename = null;
if (browser.equals("MSIE")) {
encodedFilename = URLEncoder.encode(filename, "UTF-8").replaceAll("\\+", "%20");
} else if (browser.equals("Trident")) { // IE11 문자열 깨짐 방지
encodedFilename = URLEncoder.encode(filename, "UTF-8").replaceAll("\\+", "%20");
} else if (browser.equals("Firefox")) {
encodedFilename = "\"" + new String(filename.getBytes("UTF-8"), "8859_1") + "\"";
} else if (browser.equals("Opera")) {
encodedFilename = "\"" + new String(filename.getBytes("UTF-8"), "8859_1") + "\"";
} else if (browser.equals("Chrome")) {
StringBuffer sb = new StringBuffer();
for (int i = 0; i < filename.length(); i++) {
char c = filename.charAt(i);
if (c > '~') {
sb.append(URLEncoder.encode("" + c, "UTF-8"));
} else {
sb.append(c);
}
}
encodedFilename = sb.toString();
} else {
//throw new RuntimeException("Not supported browser");
throw new IOException("Not supported browser");
}
response.setHeader("Content-Disposition", dispositionPrefix + encodedFilename);
if ("Opera".equals(browser)) {
response.setContentType("application/octet-stream;charset=UTF-8");
}
}
/**
* <pre> : </pre>
* @param model
* @param commandMap
* @param response
* @throws Exception void
* @author:
* @date: 2020. 9. 15.
*/
@SuppressWarnings("resource")
@RequestMapping(name = "", value="getImage", method={RequestMethod.GET, RequestMethod.POST})
public void getImage(ModelMap model, @RequestParam Map<String, Object> commandMap, HttpServletResponse response) throws Exception {
String atchFileId = (String) commandMap.get("atchFileId");
String fileSn = (String) commandMap.get("fileSn");
Map<String, String> fvo = xitFrameFileService.findView(atchFileId, fileSn);
File file = new File(fvo.get("fileStreCours"), fvo.get("streFileNm"));
FileInputStream fis = null;
new FileInputStream(file);
BufferedInputStream in = null;
ByteArrayOutputStream bStream = null;
try {
fis = new FileInputStream(file);
in = new BufferedInputStream(fis);
bStream = new ByteArrayOutputStream();
int imgByte;
while ((imgByte = in.read()) != -1) {
bStream.write(imgByte);
}
String type = "";
if (fvo.get("fileExtsn") != null && !"".equals(fvo.get("fileExtsn"))) {
if ("jpg".equals(fvo.get("fileExtsn").toLowerCase())) {
type = "image/jpeg";
} else {
type = "image/" + fvo.get("fileExtsn").toLowerCase();
}
type = "image/" + fvo.get("fileExtsn").toLowerCase();
} else {
logger.debug("Image fileType is null.");
}
response.setHeader("Content-Type", type);
response.setContentLength(bStream.size());
bStream.writeTo(response.getOutputStream());
response.getOutputStream().flush();
response.getOutputStream().close();
} catch (Exception e) {
logger.debug("{}", e);
} finally {
if (bStream != null) {
try {
bStream.close();
} catch (Exception est) {
logger.debug("IGNORED: {}", est.getMessage());
}
}
if (in != null) {
try {
in.close();
} catch (Exception ei) {
logger.debug("IGNORED: {}", ei.getMessage());
}
}
if (fis != null) {
try {
fis.close();
} catch (Exception efis) {
logger.debug("IGNORED: {}", efis.getMessage());
}
}
}
}
}

@ -1,151 +0,0 @@
package cokr.xit.fims.framework.biz.cmm.web;
import cokr.xit.foundation.web.AbstractController;
import cokr.xit.fims.framework.biz.cache.util.CacheServiceUtils;
import cokr.xit.fims.framework.biz.cmm.XitLoginVO;
import cokr.xit.fims.framework.biz.mng.bbs.XitBasicBbsMngSearchVO;
import cokr.xit.fims.framework.biz.mng.bbs.service.XitBasicBbsMngService;
import cokr.xit.fims.framework.core.XitMenuManageVO;
import cokr.xit.fims.framework.support.util.ConvertUtils;
import lombok.AllArgsConstructor;
import org.egovframe.rte.fdl.security.userdetails.util.EgovUserDetailsHelper;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import java.util.Map;
/**
*
* @: XIT Controller
* @:
* @: 2020. 3. 23. 3:23:12
* @:
* @author ()
* @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
@AllArgsConstructor
@Controller
@RequestMapping(name = "", value="/framework/biz/cmm/")
public class XitMainController extends AbstractController {
private final XitBasicBbsMngService xitBasicBbsMngService;
/**
* <pre> :
* [ ]
* - ~/project
* - requstMappging URL "/[임의지정]/main/mainPage"
* -globals.properties Globals.Xit.MainPage requestMappging URL
*
* </pre>
* @param request
* @param model
* @return
* @throws Exception String
* @author:
* @date: 2020. 3. 23.
*/
@RequestMapping(name = "", value = "/mainPage", method={RequestMethod.GET, RequestMethod.POST})
public String mainPage(@ModelAttribute("searchVO") XitBasicBbsMngSearchVO searchVO, HttpServletRequest request, ModelMap model, @RequestParam Map<String, Object> param) throws Exception{
return "fims/framework/biz/cmm/XitMain.main";
}
/**
* Head .
* @param menuManageVO MenuManageVO
* @return "main_headG", "main_head"
* @exception Exception
*/
@RequestMapping(name = "", value="/XitMainMenuHead", method={RequestMethod.GET, RequestMethod.POST})
public String mainMenuHead(@ModelAttribute("menuManageVO") XitMenuManageVO menuManageVO, ModelMap model) throws Exception {
XitLoginVO user = EgovUserDetailsHelper.isAuthenticated()? (XitLoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null;
if(EgovUserDetailsHelper.isAuthenticated() && user!=null){
}else{
}
return "framework/egov/main/inc/EgovIncTopnav"; // 내부업무의 상단메뉴 화면
}
/**
* .
* @param model ModelMap
* @return "main_left"
* @exception Exception
*/
@RequestMapping(name = "", value="/XitMainMenuLeft", method={RequestMethod.GET, RequestMethod.POST})
public String mainMenuLeft(ModelMap model) throws Exception {
//LoginVO user = EgovUserDetailsHelper.isAuthenticated()? (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null;
//LoginVO user = (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser();
if(EgovUserDetailsHelper.isAuthenticated()){
//인증된 경우 처리할 사항 추가 ...
model.addAttribute("lastLogoutDateTime", "로그아웃 타임: 2011-11-10 11:30");
//최근 로그아웃 시간 등에 대한 확보 후 메인 컨텐츠로 활용
}
return "framework/egov/main/inc/EgovIncLeftmenu";
}
@RequestMapping(name = "", value = "/goTo/byMenuNo")
public ModelAndView goToByMenuNo(HttpServletRequest req) throws Exception {
ModelAndView mav = new ModelAndView();
String menuNo = req.getParameter("menuNo");
if(menuNo.equals("main")){
mav.setViewName("/fims/framework/biz/cmm/dashboard.dashboard");
return mav;
}
String result = null;
if(result.endsWith(".do")){
result = result.substring(0, result.length() -3);
}
if(menuNo.equals("80000000")){
Map<String, String[]> pm = req.getParameterMap();
mav.addObject("schOpt", req.getParameter("schOpt"));
mav.addObject("schWord", req.getParameter("schWord"));
}
mav.setViewName(result);
return mav;
}
@RequestMapping(name = "", value = "/goTo/byPgmId")
public ModelAndView goToByPgmId(HttpServletRequest req) throws Exception {
ModelAndView mav = new ModelAndView();
String pgmId = req.getParameter("pgmId");
if(pgmId.equals("main")){
mav.setViewName("/fims/framework/biz/cmm/dashboard.dashboard");
return mav;
}
String result = null;
if(result.endsWith(".do")){
result = result.substring(0, result.length() -3);
}
if(pgmId.equals("80000000")){
Map<String, String[]> pm = req.getParameterMap();
mav.addObject("schOpt", req.getParameter("schOpt"));
mav.addObject("schWord", req.getParameter("schWord"));
}
mav.setViewName(result);
return mav;
}
}

@ -1,49 +0,0 @@
package cokr.xit.fims.framework.biz.mng.auth.dao;
import cokr.xit.fims.framework.biz.mng.auth.XitLoginPolicyMngSearchVO;
import cokr.xit.fims.framework.biz.mng.auth.XitLoginPolicyMngVO;
import org.egovframe.rte.psl.dataaccess.mapper.Mapper;
import java.sql.SQLException;
import java.util.List;
/**
*
* @: Mapper
* @:
* @: 2020. 4. 16. 9:38:07
* @:
* @author ()
* @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
@Mapper
public interface XitLoginPolicyMngMapper {
/**
* <pre> : </pre>
* @param searchVO
* @return List<XitLoginPolicyMngVO>
* @author:
* @date: 2020. 4. 16.
*/
public List<XitLoginPolicyMngVO> findList(XitLoginPolicyMngSearchVO searchVO) throws SQLException;
/**
* <pre> : </pre>
* @param searchVO
* @return int
* @author:
* @date: 2020. 4. 16.
*/
public int findListTotCnt(XitLoginPolicyMngSearchVO searchVO) throws SQLException;
/**
* <pre> : </pre>
* @param vo
* @return XitLoginPolicyMngVO
* @author:
* @date: 2020. 4. 16.
*/
public XitLoginPolicyMngVO findView(XitLoginPolicyMngVO vo) throws SQLException;
}

@ -1,321 +0,0 @@
package cokr.xit.fims.framework.biz.mng.auth.web;
import cokr.xit.foundation.web.AbstractController;
import cokr.xit.fims.framework.biz.cmm.XitLoginVO;
import cokr.xit.fims.framework.biz.mng.auth.XitLoginPolicyMngSearchVO;
import cokr.xit.fims.framework.biz.mng.auth.XitLoginPolicyMngVO;
import cokr.xit.fims.framework.biz.mng.auth.service.XitLoginPolicyMngService;
import cokr.xit.fims.framework.core.constants.FrameworkConstants;
import org.springframework.context.support.ReloadableResourceBundleMessageSource;
import cokr.xit.fims.framework.core.utils.XitCmmnUtil;
import cokr.xit.fims.framework.support.util.AjaxUtils;
import lombok.AllArgsConstructor;
import org.egovframe.rte.fdl.security.userdetails.util.EgovUserDetailsHelper;
import org.egovframe.rte.ptl.mvc.tags.ui.pagination.PaginationInfo;
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.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. 4. 16. 9:39:52
* @:
* @author ()
* @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
@AllArgsConstructor
@Controller
@RequestMapping(name = "", value = "/framework/biz/mng/auth/")
public class XitLoginPolicyMngController extends AbstractController {
private final XitLoginPolicyMngService xitLoginPolicyMngService;
/**
* <pre> : </pre>
* @return String
* @author:
* @date: 2020. 4. 16.
*/
@RequestMapping(name = "", value = "loginPolicyMng_list", method={RequestMethod.GET, RequestMethod.POST})
public String loginPolicyMng_list(@ModelAttribute("searchVO") XitLoginPolicyMngSearchVO searchVO, ModelMap model) {
return FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/auth/loginPolicyMng_list";
}
/**
* <pre> : </pre>
* @return String
* @author:
* @date: 2020. 8.04.
*/
@RequestMapping(name = "", value = "loginPolicyMng_list.do", method={RequestMethod.GET, RequestMethod.POST})
@ResponseBody
public Map<String, Object> loginPolicyMng_listAjax(@ModelAttribute("searchVO") XitLoginPolicyMngSearchVO 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 = xitLoginPolicyMngService.findListTotCnt(searchVO);
paginationInfo.setTotalRecordCount(totCnt);
/**
*
*/
/* ***************************
* tui Grid Response Set
*************************** */
resultMap.put("result", true); //[tui Grid] result
resultMap.put("message", "정상적으로 조회 되었습니다."); //[tui Grid] result message
Map<String, Object> data = new HashMap<String, Object>();
data.put("contents", xitLoginPolicyMngService.findList(searchVO)); //[tui Grid] data-contents
Map<String, Integer> pagination = new HashMap<String, Integer>();
pagination.put("pageNum", searchVO.getPageNum());
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", "조회에 실패하였습니다."); //[tui Grid] result message
}
return resultMap;
}
/**
* <pre> : .</pre>
* @param cmd String
* @param model
* @return String
* @author:
* @date: 2020. 4. 16.
*/
@RequestMapping(name = "", value = "loginPolicyMng_{cmd}", method={RequestMethod.GET, RequestMethod.POST})
public String loginPolicyMng_page(@PathVariable String cmd
, @ModelAttribute("vo") XitLoginPolicyMngVO vo
, @ModelAttribute("searchVO") XitLoginPolicyMngSearchVO searchVO
, ModelMap model
) {
String returnUrl = FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/auth/loginPolicyMng_"+cmd;
switch (cmd) {
case "input": //등록 페이지
model.addAttribute("loginPolicy", xitLoginPolicyMngService.findView(vo));
model.addAttribute("message", "정상적으로 조회 되었습니다.");
break;
case "edit": //수정 페이지
case "view": //상세 페이지
XitLoginPolicyMngVO result = xitLoginPolicyMngService.findView(vo);
model.addAttribute("loginPolicy", result);
model.addAttribute("message", "정상적으로 조회 되었습니다.");
if("N".equals(result.getRegYn()))
returnUrl = FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/auth/loginPolicyMng_input";
break;
default:
throw new RuntimeException("유효하지 않은 요청 입니다.");
}
return returnUrl;
}
/**
* <pre> : .</pre>
* @param cmd String
* @param model
* @return String
* @author:
* @date: 2020. 4. 16.
*/
@RequestMapping(name = "", value = "LoginPolicyMng_{cmd}_popup", method={RequestMethod.GET, RequestMethod.POST})
public String loginPolicyMng_page_popup(@PathVariable String cmd
, @ModelAttribute XitLoginPolicyMngSearchVO searchVO
, @ModelAttribute XitLoginPolicyMngVO vo, ModelMap model) {
switch (cmd) {
case "": //
break;
default:
throw new RuntimeException("유효하지 않은 요청 입니다.");
}
return FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/auth/loginPolicyMng_"+cmd+"_popup";
}
/**
* <pre> : CUD </pre>
* @return String
* @author:
* @throws IOException
* @throws ServletException
* @date: 2020. 4. 16.
*/
@RequestMapping(name = "", value = "loginPolicyMng_{cmd}_proc", method=RequestMethod.POST)
public void loginPolicyMng_cmd_proc(@PathVariable String cmd
,@ModelAttribute("vo") XitLoginPolicyMngVO vo
,@ModelAttribute("searchVO") XitLoginPolicyMngSearchVO searchVO
,@RequestParam(value="emplyrIds", required=false, defaultValue="") String emplyrIds
,BindingResult bindingResult
,SessionStatus status
,Model model
,HttpServletRequest request
,HttpServletResponse response
) throws ServletException, IOException {
/**
*
*/
XitLoginVO loginVO = (XitLoginVO) EgovUserDetailsHelper.getAuthenticatedUser();
String sLocationUrl = "forward:/framework/biz/mng/auth/loginPolicyMng_list.do";
String message = null;
switch (cmd) {
case "insert": //등록
if (bindingResult.hasErrors()) {
message = "생성에 실패하였습니다.";
sLocationUrl = "forward:/framework/biz/mng/auth/loginPolicyMng_input.do";
break;
}
//처리
try {
vo.setRgtr(loginVO.getUniqId());
vo.setMdfr(loginVO.getUniqId());
xitLoginPolicyMngService.addProc(vo);
status.setComplete();
message = "정상적으로 등록 되었습니다.";
sLocationUrl = "forward:/framework/biz/mng/auth/loginPolicyMng_edit.do";
} catch (RuntimeException e) {
message = e.getMessage();
sLocationUrl = "forward:/framework/biz/mng/auth/loginPolicyMng_input.do";
} catch (Exception e) {
message = "생성에 실패하였습니다.";
sLocationUrl = "forward:/framework/biz/mng/auth/loginPolicyMng_input.do";
}
break;
// case "inserts": //다건 등록
// break;
case "update": //수정
if (bindingResult.hasErrors()) {
message = "변경에 실패하였습니다.";
sLocationUrl = "forward:/framework/biz/mng/auth/loginPolicyMng_edit";
break;
}
//처리
try {
vo.setMdfr(loginVO.getUniqId());
xitLoginPolicyMngService.modifyProc(vo);
status.setComplete();
message = "정상적으로 변경 되었습니다.";
sLocationUrl = "forward:/framework/biz/mng/auth/loginPolicyMng_edit";
} catch (RuntimeException e) {
message = e.getMessage();
sLocationUrl = "forward:/framework/biz/mng/auth/loginPolicyMng_edit";
} catch (Exception e) {
message = "변경에 실패하였습니다.";
sLocationUrl = "forward:/framework/biz/mng/auth/loginPolicyMng_edit";
}
break;
case "delete": //삭제
//처리
try {
vo.setMdfr(loginVO.getUniqId());
xitLoginPolicyMngService.removeProc(vo);
status.setComplete();
message = "정상적으로 삭제 되었습니다.";
break;
} catch (RuntimeException e) {
message = e.getMessage();
sLocationUrl = "forward:/framework/biz/mng/auth/loginPolicyMng_edit";
} catch (Exception e) {
message = "삭제에 실패하였습니다.";
sLocationUrl = "forward:/framework/biz/mng/auth/loginPolicyMng_edit";
}
break;
case "deletes": //다건 삭제
//처리
try {
xitLoginPolicyMngService.removesProc(emplyrIds, loginVO.getUniqId());
status.setComplete();
message = "정상적으로 삭제 되었습니다.";
} catch (RuntimeException e) {
message = e.getMessage();
} catch (Exception e) {
message = "삭제에 실패하였습니다.";
}
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,34 +0,0 @@
package cokr.xit.fims.framework.biz.mng.bbs.dao;
import cokr.xit.fims.framework.biz.mng.bbs.XitBasicBbsMngVO;
import org.apache.ibatis.session.RowBounds;
import org.egovframe.rte.psl.dataaccess.mapper.Mapper;
import java.util.List;
import java.util.Map;
/**
*
* @: Mapper
* @:
* @: 2020. 4. 16. 9:38:07
* @:
* @author ()
* @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
@Mapper
public interface BoardBasicMgtMapper {
List<XitBasicBbsMngVO> selectBoardBasics(final Map<String, Object> paraMap, final RowBounds rowBounds);
<T> List<XitBasicBbsMngVO> selectBoardBasics(final T t);
<T> XitBasicBbsMngVO selectBoardBasic(final T t);
<T> XitBasicBbsMngVO selectBoardMaster(final T t);
int insertBoardBasic(final XitBasicBbsMngVO vo);
int updateBoardBasic(final XitBasicBbsMngVO vo);
}

@ -1,33 +0,0 @@
package cokr.xit.fims.framework.biz.mng.bbs.dao;
import cokr.xit.fims.framework.biz.mng.bbs.XitBbsCreateMngVO;
import org.apache.ibatis.session.RowBounds;
import org.egovframe.rte.psl.dataaccess.mapper.Mapper;
import java.util.List;
import java.util.Map;
/**
*
* @: Mapper
* @:
* @: 2020. 4. 16. 9:38:07
* @:
* @author ()
* @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
@Mapper
public interface BoardCreateMgtMapper {
List<XitBbsCreateMngVO> selectBoardMastrs(final Map<String, Object> paraMap, final RowBounds rowBounds);
<T> List<XitBbsCreateMngVO> selectBoardMastrs(final T t);
<T> XitBbsCreateMngVO selectBoardMastr(final T t);
int insertBoardMastr(final XitBbsCreateMngVO vo);
int updateBoardMastr(final XitBbsCreateMngVO vo);
<T> int deleteBoardMastr(final T t);
}

@ -1,33 +0,0 @@
package cokr.xit.fims.framework.biz.mng.bbs.dao;
import cokr.xit.fims.framework.biz.mng.bbs.XitBbsTmplateMngVO;
import org.apache.ibatis.session.RowBounds;
import org.egovframe.rte.psl.dataaccess.mapper.Mapper;
import java.util.List;
import java.util.Map;
/**
*
* @: 릿 Mapper
* @:
* @: 2020. 4. 16. 9:38:07
* @:
* @author ()
* @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
@Mapper
public interface BoardTmplMgtMapper {
List<XitBbsTmplateMngVO> selectBoardTmpls(final Map<String, Object> paraMap, final RowBounds rowBounds);
<T> List<XitBbsTmplateMngVO> selectBoardTmpls(final T t);
<T> XitBbsTmplateMngVO selectBoardTmpl(final T t);
int insertBoardTmpl(final XitBbsTmplateMngVO vo);
int updateBoardTmpl(final XitBbsTmplateMngVO vo);
<T> int deleteBoardTmpl(final T t);
}

@ -1,36 +0,0 @@
package cokr.xit.fims.framework.biz.mng.bbs.dao;
import cokr.xit.fims.framework.biz.mng.bbs.XitBbsUseMngVO;
import org.apache.ibatis.session.RowBounds;
import org.egovframe.rte.psl.dataaccess.mapper.Mapper;
import java.util.List;
import java.util.Map;
/**
*
* @: Mapper
* @:
* @: 2020. 4. 16. 9:38:07
* @:
* @author ()
* @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
@Mapper
public interface BoardUseMgtMapper {
List<XitBbsUseMngVO> selectBoardPrcuseList(final Map<String, Object> paraMap, final RowBounds rowBounds);
<T> List<XitBbsUseMngVO> selectBoardPrcuseList(final T t);
<T> XitBbsUseMngVO selectBoardPrcuse(final T t);
int insertBoardPrcuse(final XitBbsUseMngVO vo);
int updateBoardPrcuse(final XitBbsUseMngVO vo);
<T> int deleteBoardPrcuse(final T t);
}

@ -1,67 +0,0 @@
package cokr.xit.fims.framework.biz.mng.bbs.dao;
import cokr.xit.fims.framework.biz.mng.bbs.XitBasicBbsMngSearchVO;
import cokr.xit.fims.framework.biz.mng.bbs.XitBasicBbsMngVO;
import org.egovframe.rte.psl.dataaccess.mapper.Mapper;
import java.sql.SQLException;
import java.util.List;
import java.util.Map;
/**
*
* @: () Mapper
* @:
* @: 2020. 4. 16. 9:38:07
* @:
* @author ()
* @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
@Mapper
public interface XitBasicBbsMngMapper {
/**
* <pre> : () </pre>
* @param searchVO
* @return List<XitBasicBbsMngVO>
* @author:
* @date: 2020. 4. 16.
*/
public List<XitBasicBbsMngVO> findList(XitBasicBbsMngSearchVO searchVO) throws SQLException;
/**
* <pre> : () </pre>
* @param searchVO
* @return int
* @author:
* @date: 2020. 4. 16.
*/
public int findListTotCnt(XitBasicBbsMngSearchVO searchVO) throws SQLException;
/**
* <pre> : () </pre>
* @param vo
* @return XitBasicBbsMngVO
* @author:
* @date: 2020. 4. 16.
*/
public XitBasicBbsMngVO findView(XitBasicBbsMngVO vo) throws SQLException;
/**
* <pre> : ID .</pre>
* @return String
* @author:
* @date: 2020. 5. 12.
*/
public String findMaxNttId();
/**
* <pre> : .</pre>
* @param m Map<String, String>
* @return String
* @author:
* @date: 2020. 5. 12.
*/
public String findMaxNttNo(Map<String, String> m);
}

@ -1,49 +0,0 @@
package cokr.xit.fims.framework.biz.mng.bbs.dao;
import cokr.xit.fims.framework.biz.mng.bbs.XitBbsCreateMngSearchVO;
import cokr.xit.fims.framework.biz.mng.bbs.XitBbsCreateMngVO;
import org.egovframe.rte.psl.dataaccess.mapper.Mapper;
import java.sql.SQLException;
import java.util.List;
/**
*
* @: Mapper
* @:
* @: 2020. 4. 16. 9:38:07
* @:
* @author ()
* @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
@Mapper
public interface XitBbsCreateMngMapper {
/**
* <pre> : </pre>
* @param searchVO
* @return List<XitBbsCreateMngVO>
* @author:
* @date: 2020. 4. 16.
*/
public List<XitBbsCreateMngVO> findList(XitBbsCreateMngSearchVO searchVO) throws SQLException;
/**
* <pre> : </pre>
* @param searchVO
* @return int
* @author:
* @date: 2020. 4. 16.
*/
public int findListTotCnt(XitBbsCreateMngSearchVO searchVO) throws SQLException;
/**
* <pre> : </pre>
* @param vo
* @return XitBbsCreateMngVO
* @author:
* @date: 2020. 4. 16.
*/
public XitBbsCreateMngVO findView(XitBbsCreateMngVO vo) throws SQLException;
}

@ -1,49 +0,0 @@
package cokr.xit.fims.framework.biz.mng.bbs.dao;
import cokr.xit.fims.framework.biz.mng.bbs.XitBbsTmplateMngSearchVO;
import cokr.xit.fims.framework.biz.mng.bbs.XitBbsTmplateMngVO;
import org.egovframe.rte.psl.dataaccess.mapper.Mapper;
import java.sql.SQLException;
import java.util.List;
/**
*
* @: 릿 Mapper
* @:
* @: 2020. 4. 16. 9:38:07
* @:
* @author ()
* @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
@Mapper
public interface XitBbsTmplateMngMapper {
/**
* <pre> : 릿 </pre>
* @param searchVO
* @return List<XitBbsTmplateMngVO>
* @author:
* @date: 2020. 4. 16.
*/
public List<XitBbsTmplateMngVO> findList(XitBbsTmplateMngSearchVO searchVO) throws SQLException;
/**
* <pre> : 릿 </pre>
* @param searchVO
* @return int
* @author:
* @date: 2020. 4. 16.
*/
public int findListTotCnt(XitBbsTmplateMngSearchVO searchVO) throws SQLException;
/**
* <pre> : 릿 </pre>
* @param vo
* @return XitBbsTmplateMngVO
* @author:
* @date: 2020. 4. 16.
*/
public XitBbsTmplateMngVO findView(XitBbsTmplateMngVO vo) throws SQLException;
}

@ -1,49 +0,0 @@
package cokr.xit.fims.framework.biz.mng.bbs.dao;
import cokr.xit.fims.framework.biz.mng.bbs.XitBbsUseMngSearchVO;
import cokr.xit.fims.framework.biz.mng.bbs.XitBbsUseMngVO;
import org.egovframe.rte.psl.dataaccess.mapper.Mapper;
import java.sql.SQLException;
import java.util.List;
/**
*
* @: Mapper
* @:
* @: 2020. 4. 16. 9:38:07
* @:
* @author ()
* @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
@Mapper
public interface XitBbsUseMngMapper {
/**
* <pre> : </pre>
* @param searchVO
* @return List<XitBbsUseMngVO>
* @author:
* @date: 2020. 4. 16.
*/
public List<XitBbsUseMngVO> findList(XitBbsUseMngSearchVO searchVO) throws SQLException;
/**
* <pre> : </pre>
* @param searchVO
* @return int
* @author:
* @date: 2020. 4. 16.
*/
public int findListTotCnt(XitBbsUseMngSearchVO searchVO) throws SQLException;
/**
* <pre> : </pre>
* @param vo
* @return XitBbsUseMngVO
* @author:
* @date: 2020. 4. 16.
*/
public XitBbsUseMngVO findView(XitBbsUseMngVO vo) throws SQLException;
}

@ -1,32 +0,0 @@
package cokr.xit.fims.framework.biz.mng.bbs.service;
import cokr.xit.fims.framework.biz.mng.bbs.XitBasicBbsMngVO;
import cokr.xit.fims.framework.core.utils.XitCmmnUtil;
import org.apache.ibatis.session.RowBounds;
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 BoardBasicMgtService {
List<XitBasicBbsMngVO> findBoardBasicList(final Map<String, Object> paraMap, final RowBounds rowBounds);
<T> List<XitBasicBbsMngVO> findBoardBasicList(final T t);
<T> XitBasicBbsMngVO findBoardBasic(final T t);
<T> XitBasicBbsMngVO findBoardMaster(final T t);
void addBoardBasic(final XitBasicBbsMngVO vo);
void modifyBoardBasic(final XitBasicBbsMngVO vo);
default String getUserUniqId(){
return XitCmmnUtil.getUserUniqId();
}
}

@ -1,32 +0,0 @@
package cokr.xit.fims.framework.biz.mng.bbs.service;
import cokr.xit.fims.framework.biz.mng.bbs.XitBbsCreateMngVO;
import cokr.xit.fims.framework.core.utils.XitCmmnUtil;
import org.apache.ibatis.session.RowBounds;
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 BoardCreateMgtService {
List<XitBbsCreateMngVO> findBoardCreateList(final Map<String, Object> paraMap, final RowBounds rowBounds);
<T> List<XitBbsCreateMngVO> findBoardCreateList(final T t);
<T> XitBbsCreateMngVO findBoardCreate(final T t);
void addBoardCreate(final XitBbsCreateMngVO vo);
void modifyBoardCreate(final XitBbsCreateMngVO vo);
<T> void removeBoardCreate(final T t);
default String getUserUniqId(){
return XitCmmnUtil.getUserUniqId();
}
}

@ -1,33 +0,0 @@
package cokr.xit.fims.framework.biz.mng.bbs.service;
import cokr.xit.fims.framework.biz.mng.bbs.XitBbsTmplateMngVO;
import cokr.xit.fims.framework.core.utils.XitCmmnUtil;
import org.apache.ibatis.session.RowBounds;
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 BoardTmplMgtService {
List<XitBbsTmplateMngVO> findBoardTmpls(final Map<String, Object> paraMap, final RowBounds rowBounds);
<T> List<XitBbsTmplateMngVO> findBoardTmpls(final T t);
<T> XitBbsTmplateMngVO findBoardTmpl(final T t);
void addBoardTmpl(final XitBbsTmplateMngVO vo);
void modifyBoardTmpl(final XitBbsTmplateMngVO vo);
<T> void removeBoardTmpl(final T t);
default String getUserUniqId(){
return XitCmmnUtil.getUserUniqId();
}
}

@ -1,34 +0,0 @@
package cokr.xit.fims.framework.biz.mng.bbs.service;
import cokr.xit.fims.framework.biz.mng.bbs.XitBbsUseMngVO;
import cokr.xit.fims.framework.core.utils.XitCmmnUtil;
import org.apache.ibatis.session.RowBounds;
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 BoardUseMgtService {
List<XitBbsUseMngVO> findBoardPrcuseList(final Map<String, Object> paraMap, final RowBounds rowBounds);
<T> List<XitBbsUseMngVO> findBoardPrcuseList(final T t);
<T> XitBbsUseMngVO findBoardPrcuse(final T t);
void addBoardPrcuse(final XitBbsUseMngVO vo);
void modifyBoardPrcuse(final XitBbsUseMngVO vo);
<T> void removeBoardPrcuse(final T t);
default String getUserUniqId(){
return XitCmmnUtil.getUserUniqId();
}
}

@ -1,79 +0,0 @@
package cokr.xit.fims.framework.biz.mng.bbs.service;
import cokr.xit.fims.framework.biz.mng.bbs.XitBasicBbsMngSearchVO;
import cokr.xit.fims.framework.biz.mng.bbs.XitBasicBbsMngVO;
import java.util.List;
/**
*
* @: () Service
* @:
* @: 2020. 4. 16. 9:38:56
* @:
* @author ()
* @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
public interface XitBasicBbsMngService {
/**
* <pre> : () </pre>
* @param searchVO
* @return List<XitBasicBbsMngVO>
* @author:
* @date: 2020. 4. 16.
*/
public List<XitBasicBbsMngVO> findList(XitBasicBbsMngSearchVO searchVO);
/**
* <pre> : () </pre>
* @param searchVO
* @return int
* @author:
* @date: 2020. 4. 16.
*/
public int findListTotCnt(XitBasicBbsMngSearchVO searchVO);
/**
* <pre> : () </pre>
* @param vo
* @return XitBasicBbsMngVO
* @author:
* @date: 2020. 4. 16.
*/
public XitBasicBbsMngVO findView(XitBasicBbsMngVO vo);
/**
* <pre> : () </pre>
* @param vo void
* @author:
* @date: 2020. 4. 16.
*/
public void addProc(XitBasicBbsMngVO vo);
/**
* <pre> : () </pre>
* @param vo void
* @author:
* @date: 2020. 4. 16.
*/
public void modifyProc(XitBasicBbsMngVO vo);
/**
* <pre> : () </pre>
* @param vo void
* @author:
* @date: 2020. 4. 16.
*/
public void removeProc(XitBasicBbsMngVO vo);
/**
* <pre> : () </pre>
* @param ids void
* @author:
* @date: 2020. 4. 16.
*/
public void removesProc(String ids, String userId);
}

@ -1,79 +0,0 @@
package cokr.xit.fims.framework.biz.mng.bbs.service;
import cokr.xit.fims.framework.biz.mng.bbs.XitBbsCreateMngSearchVO;
import cokr.xit.fims.framework.biz.mng.bbs.XitBbsCreateMngVO;
import java.util.List;
/**
*
* @: Service
* @:
* @: 2020. 4. 16. 9:38:56
* @:
* @author ()
* @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
public interface XitBbsCreateMngService {
/**
* <pre> : </pre>
* @param searchVO
* @return List<XitBbsCreateMngVO>
* @author:
* @date: 2020. 4. 16.
*/
public List<XitBbsCreateMngVO> findList(XitBbsCreateMngSearchVO searchVO);
/**
* <pre> : </pre>
* @param searchVO
* @return int
* @author:
* @date: 2020. 4. 16.
*/
public int findListTotCnt(XitBbsCreateMngSearchVO searchVO);
/**
* <pre> : </pre>
* @param vo
* @return XitBbsCreateMngVO
* @author:
* @date: 2020. 4. 16.
*/
public XitBbsCreateMngVO findView(XitBbsCreateMngVO vo);
/**
* <pre> : </pre>
* @param vo void
* @author:
* @date: 2020. 4. 16.
*/
public void addProc(XitBbsCreateMngVO vo);
/**
* <pre> : </pre>
* @param vo void
* @author:
* @date: 2020. 4. 16.
*/
public void modifyProc(XitBbsCreateMngVO vo);
/**
* <pre> : </pre>
* @param vo void
* @author:
* @date: 2020. 4. 16.
*/
public void removeProc(XitBbsCreateMngVO vo);
/**
* <pre> : </pre>
* @param ids void
* @author:
* @date: 2020. 4. 16.
*/
public void removesProc(String ids, String userId);
}

@ -1,79 +0,0 @@
package cokr.xit.fims.framework.biz.mng.bbs.service;
import cokr.xit.fims.framework.biz.mng.bbs.XitBbsTmplateMngSearchVO;
import cokr.xit.fims.framework.biz.mng.bbs.XitBbsTmplateMngVO;
import java.util.List;
/**
*
* @: 릿 Service
* @:
* @: 2020. 4. 16. 9:38:56
* @:
* @author ()
* @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
public interface XitBbsTmplateMngService {
/**
* <pre> : 릿 </pre>
* @param searchVO
* @return List<XitBbsTmplateMngVO>
* @author:
* @date: 2020. 4. 16.
*/
public List<XitBbsTmplateMngVO> findList(XitBbsTmplateMngSearchVO searchVO);
/**
* <pre> : 릿 </pre>
* @param searchVO
* @return int
* @author:
* @date: 2020. 4. 16.
*/
public int findListTotCnt(XitBbsTmplateMngSearchVO searchVO);
/**
* <pre> : 릿 </pre>
* @param vo
* @return XitBbsTmplateMngVO
* @author:
* @date: 2020. 4. 16.
*/
public XitBbsTmplateMngVO findView(XitBbsTmplateMngVO vo);
/**
* <pre> : 릿 </pre>
* @param vo void
* @author:
* @date: 2020. 4. 16.
*/
public void addProc(XitBbsTmplateMngVO vo);
/**
* <pre> : 릿 </pre>
* @param vo void
* @author:
* @date: 2020. 4. 16.
*/
public void modifyProc(XitBbsTmplateMngVO vo);
/**
* <pre> : 릿 </pre>
* @param vo void
* @author:
* @date: 2020. 4. 16.
*/
public void removeProc(XitBbsTmplateMngVO vo);
/**
* <pre> : 릿 </pre>
* @param ids void
* @author:
* @date: 2020. 4. 16.
*/
public void removesProc(String ids, String userId);
}

@ -1,79 +0,0 @@
package cokr.xit.fims.framework.biz.mng.bbs.service;
import cokr.xit.fims.framework.biz.mng.bbs.XitBbsUseMngSearchVO;
import cokr.xit.fims.framework.biz.mng.bbs.XitBbsUseMngVO;
import java.util.List;
/**
*
* @: Service
* @:
* @: 2020. 4. 16. 9:38:56
* @:
* @author ()
* @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
public interface XitBbsUseMngService {
/**
* <pre> : </pre>
* @param searchVO
* @return List<XitBbsUseMngVO>
* @author:
* @date: 2020. 4. 16.
*/
public List<XitBbsUseMngVO> findList(XitBbsUseMngSearchVO searchVO);
/**
* <pre> : </pre>
* @param searchVO
* @return int
* @author:
* @date: 2020. 4. 16.
*/
public int findListTotCnt(XitBbsUseMngSearchVO searchVO);
/**
* <pre> : </pre>
* @param vo
* @return XitBbsUseMngVO
* @author:
* @date: 2020. 4. 16.
*/
public XitBbsUseMngVO findView(XitBbsUseMngVO vo);
/**
* <pre> : </pre>
* @param vo void
* @author:
* @date: 2020. 4. 16.
*/
public void addProc(XitBbsUseMngVO vo);
/**
* <pre> : </pre>
* @param vo void
* @author:
* @date: 2020. 4. 16.
*/
public void modifyProc(XitBbsUseMngVO vo);
/**
* <pre> : </pre>
* @param vo void
* @author:
* @date: 2020. 4. 16.
*/
public void removeProc(XitBbsUseMngVO vo);
/**
* <pre> : </pre>
* @param ids void
* @author:
* @date: 2020. 4. 16.
*/
public void removesProc(String ids, String userId);
}

@ -1,111 +0,0 @@
package cokr.xit.fims.framework.biz.mng.bbs.service.bean;
import cokr.xit.foundation.component.AbstractServiceBean;
import cokr.xit.fims.biz.FimsConst;
import cokr.xit.fims.framework.biz.cmm.CmmFileDTO;
import cokr.xit.fims.framework.biz.cmm.service.CmmFileService;
import cokr.xit.fims.framework.biz.mng.bbs.dao.BoardBasicMgtMapper;
import cokr.xit.fims.framework.biz.mng.bbs.XitBasicBbsMngVO;
import cokr.xit.fims.framework.biz.mng.bbs.service.BoardBasicMgtService;
import cokr.xit.fims.framework.support.util.Checks;
import lombok.RequiredArgsConstructor;
import org.apache.ibatis.session.RowBounds;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
@RequiredArgsConstructor
@Service
public class BoardBasicMgtServiceBean extends AbstractServiceBean implements BoardBasicMgtService {
private String uploadCmmBoardPath = "/cmm-board";
private final BoardBasicMgtMapper mapper;
private final CmmFileService cmmFileService;
@Override
@Transactional(readOnly = true)
public List<XitBasicBbsMngVO> findBoardBasicList(final Map<String, Object> paraMap, final RowBounds rowBounds) {
return mapper.selectBoardBasics(paraMap, rowBounds);
}
@Override
@Transactional(readOnly = true)
public <T> List<XitBasicBbsMngVO> findBoardBasicList(final T t) {
return mapper.selectBoardBasics(t);
}
@Override
@Transactional(readOnly = true)
public <T> XitBasicBbsMngVO findBoardBasic(final T t) {
return mapper.selectBoardBasic(t);
}
@Override
@Transactional(readOnly = true)
public <T> XitBasicBbsMngVO findBoardMaster(final T t) {
return mapper.selectBoardMaster(t);
}
@Override
@Transactional
public void addBoardBasic(final XitBasicBbsMngVO vo) {
//댓글여부
boolean isReply = "Y".equals(vo.getReplyAt());
if(!isReply) {
//댓글이 아닌 경우 초기설정
vo.setParntsSntncNo(0); //부모 게시물번호
vo.setAnswerLc(0); //댓글위치
vo.setAnswerYn("N"); //댓글여부
}
vo.setRgtr(getUserUniqId());
mapper.insertBoardBasic(vo);
if(vo.getFiles() == null ? false : vo.getFiles().length > 0) {
CmmFileDTO.FileMst fm = cmmFileService.saveFiles(getFileMst(vo.getBbsId()+"_"+vo.getNttId()), Arrays.asList(vo.getFiles()));
vo.setAtchFileId(fm.getFileMastrId());
vo.setMdfr(getUserUniqId());
mapper.updateBoardBasic(vo);
}
}
@Override
@Transactional
public void modifyBoardBasic(final XitBasicBbsMngVO vo) {
//삭제여부 없는 경우 업데이트
if(Checks.isEmpty(vo.getUseYn()) && Checks.isNotEmpty(vo.getFiles())){
if(Checks.isEmpty(vo.getFilePath())){
CmmFileDTO.FileMst fm = cmmFileService.saveFiles(getFileMst(vo.getBbsId()+"_"+vo.getNttId()), Arrays.asList(vo.getFiles()));
vo.setAtchFileId(fm.getFileMastrId());
}else{
//파일 추가 기능
CmmFileDTO.FileDtl cmmFileDtl = CmmFileDTO.FileDtl.builder()
.fileMastrId(vo.getAtchFileId())
.filePath(vo.getFilePath())
.build();
cmmFileService.saveAddFileDtl(cmmFileDtl, Arrays.asList(vo.getFiles()), false);
}
}
vo.setMdfr(getUserUniqId());
mapper.updateBoardBasic(vo);
}
private CmmFileDTO.FileMst getFileMst(final String infKey) {
return CmmFileDTO.FileMst.builder()
.infType(FimsConst.FileInfType.CMM_BOARD.getCode())
.infKey(infKey)
.uploadeJobPath(uploadCmmBoardPath)
.fileDirPath(FimsConst.FileDirDepth.MONTH.getCode())
.cmmFileDtls(new ArrayList<>())
.build();
}
}

@ -1,58 +0,0 @@
package cokr.xit.fims.framework.biz.mng.bbs.service.bean;
import cokr.xit.foundation.component.AbstractServiceBean;
import cokr.xit.fims.framework.biz.mng.bbs.dao.BoardCreateMgtMapper;
import cokr.xit.fims.framework.biz.mng.bbs.XitBbsCreateMngVO;
import cokr.xit.fims.framework.biz.mng.bbs.service.BoardCreateMgtService;
import lombok.RequiredArgsConstructor;
import org.apache.ibatis.session.RowBounds;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Map;
@RequiredArgsConstructor
@Service
public class BoardCreateMgtServiceBean extends AbstractServiceBean implements BoardCreateMgtService {
private final BoardCreateMgtMapper mapper;
@Override
@Transactional(readOnly = true)
public List<XitBbsCreateMngVO> findBoardCreateList(final Map<String, Object> paraMap, final RowBounds rowBounds) {
return mapper.selectBoardMastrs(paraMap, rowBounds);
}
@Override
@Transactional(readOnly = true)
public <T> List<XitBbsCreateMngVO> findBoardCreateList(final T t) {
return mapper.selectBoardMastrs(t);
}
@Override
@Transactional(readOnly = true)
public <T> XitBbsCreateMngVO findBoardCreate(final T t) {
return mapper.selectBoardMastr(t);
}
@Override
@Transactional
public void addBoardCreate(final XitBbsCreateMngVO vo) {
vo.setRgtr(getUserUniqId());
mapper.insertBoardMastr(vo);
}
@Override
@Transactional
public void modifyBoardCreate(final XitBbsCreateMngVO vo) {
vo.setMdfr(getUserUniqId());
mapper.updateBoardMastr(vo);
}
@Override
@Transactional
public <T> void removeBoardCreate(final T t) {
mapper.deleteBoardMastr(t);
}
}

@ -1,68 +0,0 @@
package cokr.xit.fims.framework.biz.mng.bbs.service.bean;
import cokr.xit.foundation.component.AbstractServiceBean;
import cokr.xit.fims.framework.biz.mng.bbs.dao.BoardTmplMgtMapper;
import cokr.xit.fims.framework.biz.mng.bbs.XitBbsTmplateMngVO;
import cokr.xit.fims.framework.biz.mng.bbs.service.BoardTmplMgtService;
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.cmmn.exception.FdlException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Map;
@RequiredArgsConstructor
@Service
public class BoardTmplMgtServiceBean extends AbstractServiceBean implements BoardTmplMgtService {
private final BoardTmplMgtMapper mapper;
@Override
@Transactional(readOnly = true)
public List<XitBbsTmplateMngVO> findBoardTmpls(final Map<String, Object> paraMap, final RowBounds rowBounds) {
return mapper.selectBoardTmpls(paraMap, rowBounds);
}
@Override
@Transactional(readOnly = true)
public <T> List<XitBbsTmplateMngVO> findBoardTmpls(final T t) {
return mapper.selectBoardTmpls(t);
}
@Override
@Transactional(readOnly = true)
public <T> XitBbsTmplateMngVO findBoardTmpl(final T t) {
return mapper.selectBoardTmpl(t);
}
@Override
@Transactional
public void addBoardTmpl(final XitBbsTmplateMngVO vo) {
vo.setTmplatId("nextstringid");
vo.setRgtr(getUserUniqId());
mapper.insertBoardTmpl(vo);
}
@Override
@Transactional
public void modifyBoardTmpl(final XitBbsTmplateMngVO vo) {
vo.setMdfr(getUserUniqId());
mapper.updateBoardTmpl(vo);
}
@Override
@Transactional
public <T> void removeBoardTmpl(final T t) {
mapper.deleteBoardTmpl(t);
}
}

@ -1,60 +0,0 @@
package cokr.xit.fims.framework.biz.mng.bbs.service.bean;
import cokr.xit.foundation.component.AbstractServiceBean;
import cokr.xit.fims.framework.biz.mng.bbs.dao.BoardUseMgtMapper;
import cokr.xit.fims.framework.biz.mng.bbs.XitBbsUseMngVO;
import cokr.xit.fims.framework.biz.mng.bbs.service.BoardUseMgtService;
import lombok.RequiredArgsConstructor;
import org.apache.ibatis.session.RowBounds;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Map;
@RequiredArgsConstructor
@Service
public class BoardUseMgtServiceBean extends AbstractServiceBean implements BoardUseMgtService {
private final BoardUseMgtMapper mapper;
@Override
@Transactional(readOnly = true)
public List<XitBbsUseMngVO> findBoardPrcuseList(final Map<String, Object> paraMap, final RowBounds rowBounds) {
return mapper.selectBoardPrcuseList(paraMap, rowBounds);
}
@Override
@Transactional(readOnly = true)
public <T> List<XitBbsUseMngVO> findBoardPrcuseList(T t) {
return mapper.selectBoardPrcuseList(t);
}
@Override
@Transactional(readOnly = true)
public <T> XitBbsUseMngVO findBoardPrcuse(T t) {
return mapper.selectBoardPrcuse(t);
}
@Override
@Transactional
public void addBoardPrcuse(XitBbsUseMngVO vo) {
vo.setRgtr(getUserUniqId());
mapper.insertBoardPrcuse(vo);
}
@Override
@Transactional
public void modifyBoardPrcuse(XitBbsUseMngVO vo) {
vo.setMdfr(getUserUniqId());
mapper.updateBoardPrcuse(vo);
}
@Override
@Transactional
public <T> void removeBoardPrcuse(T t) {
mapper.deleteBoardPrcuse(t);
}
}

@ -1,219 +0,0 @@
package cokr.xit.fims.framework.biz.mng.bbs.service.bean;
import cokr.xit.foundation.component.AbstractServiceBean;
import cokr.xit.fims.framework.biz.cmm.XitBbsVO;
import cokr.xit.fims.framework.biz.cmm.XitFileAttrbVO;
import cokr.xit.fims.framework.biz.cmm.service.XitFrameCrudService;
import cokr.xit.fims.framework.biz.cmm.service.XitFrameUnitService;
import cokr.xit.fims.framework.biz.mng.bbs.dao.XitBasicBbsMngMapper;
import cokr.xit.fims.framework.biz.mng.bbs.XitBasicBbsMngSearchVO;
import cokr.xit.fims.framework.biz.mng.bbs.XitBasicBbsMngVO;
import cokr.xit.fims.framework.biz.mng.bbs.service.XitBasicBbsMngService;
import org.springframework.context.support.ReloadableResourceBundleMessageSource;
import cokr.xit.fims.framework.core.utils.XitCmmnUtil;
import cokr.xit.fims.framework.core.utils.egov.EgovDateUtil;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.sql.SQLException;
import java.util.*;
@Service
public class XitBasicBbsMngServiceBean extends AbstractServiceBean implements XitBasicBbsMngService {
@Resource
private XitBasicBbsMngMapper xitBasicBbsMngMapper;
@Resource
private XitFrameCrudService xitFrameCrudService;
@Resource
private XitFrameUnitService xitFrameUnitService;
@Override
public List<XitBasicBbsMngVO> findList(XitBasicBbsMngSearchVO searchVO) {
List<XitBasicBbsMngVO> result = new ArrayList<XitBasicBbsMngVO>();
try {
List<XitBasicBbsMngVO> list = xitBasicBbsMngMapper.findList(searchVO);
if ("BBSA01".equals(searchVO.getAttrbFlag())) {
// 유효게시판 임
String today = XitCmmnUtil.getToDate("yyyyMMdd");
XitBasicBbsMngVO vo = null;
Iterator<XitBasicBbsMngVO> iter = list.iterator();
while (iter.hasNext()) {
vo = (XitBasicBbsMngVO)iter.next();
if (!"".equals(vo.getNtceBgnde()) || !"".equals(vo.getAtchPosblFileNumber())) {
if (EgovDateUtil.getDaysDiff(today, vo.getNtceBgnde()) > 0 || EgovDateUtil.getDaysDiff(today, String.valueOf(vo.getAtchPosblFileNumber())) < 0) {
// 시작일이 오늘날짜보다 크거나, 종료일이 오늘 날짜보다 작은 경우
vo.setIsExpired("Y");
}
}
result.add(vo);
}
} else {
result = list;
}
} catch (SQLException e) {
throw new RuntimeException("기본(공용)게시판 목록 조회 FAIL::", e);
}
return result;
}
@Override
public int findListTotCnt(XitBasicBbsMngSearchVO searchVO) {
int result = 0;
try {
result = xitBasicBbsMngMapper.findListTotCnt(searchVO);
} catch (SQLException e) {
throw new RuntimeException("기본(공용)게시판 목록 총건수 조회 FAIL::", e);
}
return result;
}
@Override
public XitBasicBbsMngVO findView(XitBasicBbsMngVO vo) {
XitBasicBbsMngVO result = null;
try {
//게시글 조회건수 업데이트
if(vo.isPlusCount())
xitFrameUnitService.modifyBbsRdcnt(vo.getBbsId(), String.valueOf(vo.getNttId()), vo.getMdfr());
//조회
result = xitBasicBbsMngMapper.findView(vo);
} catch (SQLException e) {
throw new RuntimeException("기본(공용)게시판 상세정보 조회 FAIL::", e);
}
return result;
}
@Override
public void addProc(XitBasicBbsMngVO vo) {
/**
*
*/
//댓글여부
boolean isReply = "Y".equals(vo.getReplyAt());
//게시판VO
XitBbsVO bbsVO = convertToCrudVO(vo);
bbsVO.setNttId(xitBasicBbsMngMapper.findMaxNttId());
bbsVO.setRgtr(vo.getRgtr());
/**
*
* -
*/
if(isReply) {
//게시물번호 채번
Map<String, String> m = new HashMap<String, String>();
m.put("bbsId", bbsVO.getBbsId());
m.put("parntsSntncNo", bbsVO.getParntsSntncNo());
bbsVO.setNttNo(xitBasicBbsMngMapper.findMaxNttNo(m));
//게시물 등록
xitFrameCrudService.addXitBbs(bbsVO);
}else {
//댓글이 아닌 경우 초기설정
bbsVO.setParntsSntncNo("0"); //부모 게시물번호
bbsVO.setAnswerLc("0"); //댓글위치
bbsVO.setAnswerYn("N"); //댓글여부
//게시물 등록
xitFrameCrudService.addXitBbs(bbsVO);
}
}
@Override
public void modifyProc(XitBasicBbsMngVO vo) {
/**
*
*/
XitBbsVO bbsVO = convertToCrudVO(vo);
bbsVO.setMdfr(vo.getMdfr());
/**
*
*/
xitFrameCrudService.modifyXitBbs(bbsVO);
}
@Override
public void removeProc(XitBasicBbsMngVO vo) {
/**
*
*/
//게시판VO
XitBbsVO bbsVO = new XitBbsVO();
bbsVO.setBbsId(vo.getBbsId());
bbsVO.setNttId(vo.getNttId()+"");
bbsVO.setNttSj("이 글은 작성자에 의해서 삭제되었습니다.");
bbsVO.setMdfr(vo.getMdfr());
bbsVO.setUseYn("N");
//파일속성VO
XitFileAttrbVO fileAttrbVO = null;
if(XitCmmnUtil.notEmpty(vo.getAtchFileId())) {
fileAttrbVO = new XitFileAttrbVO();
fileAttrbVO.setAtchFileId(vo.getAtchFileId());
fileAttrbVO.setUseYn("N");
}
/**
*
* - .
*/
xitFrameCrudService.modifyXitBbs(bbsVO);
if(fileAttrbVO != null)
xitFrameCrudService.modifyXitFileAttrb(fileAttrbVO);
}
@Override
public void removesProc(String ids, String userId) {
// /**
// * 처리
// */
// String [] codeIds = ids.split(";");
// for(int i=0; i<codeIds.length;i++) {
// XitBasicBbsMngVO vo = new XitBasicBbsMngVO();
// vo.setGrpId(codeIds[i]);
// vo.setMdfr(userId);
// this.removeProc(vo);
// }
}
/**
* <pre>
* : VO CRUD Service VO .
* </pre>
*
* @return XitBbsVO
* @author:
* @date: 2020. 4. 16.
*/
private XitBbsVO convertToCrudVO(XitBasicBbsMngVO vo) {
XitBbsVO crudVO = new XitBbsVO();
crudVO.setBbsId(vo.getBbsId()); //게시판 id
crudVO.setNttId(vo.getNttId()+""); //게시물 id
crudVO.setNttNo(vo.getNttNo()+""); //게시물 번호
crudVO.setNttSj(vo.getNttSj()); //게시물 제목
crudVO.setNttCn(vo.getNttCn()); //게시물 내용
crudVO.setAnswerYn(vo.getReplyAt()); //댓글 여부
crudVO.setParntsSntncNo(vo.getParnts()); //부모 글 번호
crudVO.setAnswerLc(vo.getReplyLc()); //댓글 위치
crudVO.setSrtOrd(vo.getSrtOrd()+""); //정렬 순서
// crudVO.setRdcnt(vo.getInqireCo()+""); //조회수
crudVO.setUseYn(vo.getUseYn()); //사용 여부
crudVO.setNtceBeginDe(vo.getNtceBgnde()); //게시 시작 일
crudVO.setNtceEndDe(String.valueOf(vo.getAtchPosblFileNumber())); //게시 종료 일
crudVO.setNtcrId(vo.getNtcrId()); //게시자 id
crudVO.setNtcrNm(vo.getNtcrNm()); //게시자 명
crudVO.setPasswd(vo.getPasswd()); //비밀번호
crudVO.setAtchFileId(vo.getAtchFileId()); //첨부 파일 id
return crudVO;
}
}

@ -1,173 +0,0 @@
package cokr.xit.fims.framework.biz.mng.bbs.service.bean;
import cokr.xit.foundation.component.AbstractServiceBean;
import cokr.xit.fims.framework.biz.cmm.XitBbsMastrVO;
import cokr.xit.fims.framework.biz.cmm.XitBbsPrcuseVO;
import cokr.xit.fims.framework.biz.cmm.service.XitFrameCrudService;
import cokr.xit.fims.framework.biz.mng.bbs.dao.XitBbsCreateMngMapper;
import cokr.xit.fims.framework.biz.mng.bbs.XitBbsCreateMngSearchVO;
import cokr.xit.fims.framework.biz.mng.bbs.XitBbsCreateMngVO;
import cokr.xit.fims.framework.biz.mng.bbs.service.XitBbsCreateMngService;
import org.springframework.context.support.ReloadableResourceBundleMessageSource;
import org.egovframe.rte.fdl.cmmn.exception.FdlException;
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 XitBbsCreateMngServiceBean extends AbstractServiceBean implements XitBbsCreateMngService{
@Resource
private XitBbsCreateMngMapper XitBbsCreateMngMapper;
@Resource
private XitFrameCrudService xitFrameCrudService;
@Override
public List<XitBbsCreateMngVO> findList(XitBbsCreateMngSearchVO searchVO) {
List<XitBbsCreateMngVO> result = null;
try {
result = XitBbsCreateMngMapper.findList(searchVO);
} catch (SQLException e) {
throw new RuntimeException("게시판생성관리 목록 조회 FAIL::", e);
}
return result;
}
@Override
public int findListTotCnt(XitBbsCreateMngSearchVO searchVO) {
int result = 0;
try {
result = XitBbsCreateMngMapper.findListTotCnt(searchVO);
} catch (SQLException e) {
throw new RuntimeException("게시판생성관리 목록 총건수 조회 FAIL::", e);
}
return result;
}
@Override
public XitBbsCreateMngVO findView(XitBbsCreateMngVO vo) {
XitBbsCreateMngVO result = null;
try {
result = XitBbsCreateMngMapper.findView(vo);
} catch (SQLException e) {
throw new RuntimeException("게시판생성관리 상세정보 조회 FAIL::", e);
}
return result;
}
@Override
public void addProc(XitBbsCreateMngVO vo) {
/**
*
*/
//게시판마스터
String bbsId = null;
bbsId = "nextstringid";
vo.setBbsId(bbsId);
vo.setUseYn("Y");
XitBbsMastrVO bbsMastrVO = convertToCrudVO(vo);
bbsMastrVO.setRgtr(vo.getRgtr());
//게시판활용
XitBbsPrcuseVO bbsPrcuseVO = null;
if ("Y".equals(vo.getBbsUseFlag())) {
bbsPrcuseVO = new XitBbsPrcuseVO();
bbsPrcuseVO.setBbsId(bbsId);
bbsPrcuseVO.setTrgetId(vo.getTrgetId());
bbsPrcuseVO.setRegistSeCode(vo.getRegistSeCode());
bbsPrcuseVO.setRgtr(vo.getRgtr());
bbsPrcuseVO.setUseYn("Y");
}
/**
*
*/
//게시판마스터
xitFrameCrudService.addXitBbsMastr(bbsMastrVO);
if (bbsPrcuseVO != null)
xitFrameCrudService.addXitBbsPrcuse(bbsPrcuseVO);
}
@Override
public void modifyProc(XitBbsCreateMngVO vo) {
/**
*
*/
vo.setUseYn("Y");
XitBbsMastrVO bbsMastrVO = convertToCrudVO(vo);
bbsMastrVO.setMdfr(vo.getMdfr());
/**
*
*/
xitFrameCrudService.modifyXitBbsMastr(bbsMastrVO);
}
@Override
public void removeProc(XitBbsCreateMngVO vo) {
/**
*
*/
XitBbsMastrVO bbsMastrVO = new XitBbsMastrVO();
bbsMastrVO.setBbsId(vo.getBbsId());
bbsMastrVO.setUseYn("N");
bbsMastrVO.setMdfr(vo.getMdfr());
/**
*
*/
xitFrameCrudService.modifyXitBbsMastr(bbsMastrVO);
}
@Override
public void removesProc(String ids, String userId) {
/**
*
*/
String [] codeIds = ids.split(";");
for(int i=0; i<codeIds.length;i++) {
XitBbsCreateMngVO vo = new XitBbsCreateMngVO();
vo.setBbsId(codeIds[i]);
vo.setMdfr(userId);
this.removeProc(vo);
}
}
/**
* <pre>
* : VO CRUD Service VO .
* </pre>
*
* @return XitBbsMastrVO
* @author:
* @date: 2020. 4. 16.
*/
private XitBbsMastrVO convertToCrudVO(XitBbsCreateMngVO vo) {
XitBbsMastrVO crudVO = new XitBbsMastrVO();
crudVO.setBbsId(vo.getBbsId()); //게시판 id
crudVO.setBbsNm(vo.getBbsNm()); //게시판 명
crudVO.setBbsIntrcn(vo.getBbsIntrcn()); //게시판 소개
crudVO.setBbsTyCode(vo.getBbsTyCode()); //게시판 유형 코드
crudVO.setBbsAttrbCode(vo.getBbsAttrbCode()); //게시판 속성 코드
crudVO.setReplyPosblYn(vo.getReplyPosblYn()); //답장 가능 여부
crudVO.setFileAtchPosblYn(vo.getFileAtchPosblYn()); //파일 첨부 가능 여부
crudVO.setAtchPosblFileNumber(""+vo.getAtchPosblFileNumber()); //첨부 가능 파일 숫자
crudVO.setAtchPosblFileSize(vo.getPosblAtchFileSize()); //첨부 가능 파일 사이즈
crudVO.setUseYn(vo.getUseYn()); //사용 여부
crudVO.setTmplatId(vo.getTmplatId()); //템플릿 id
return crudVO;
}
}

@ -1,149 +0,0 @@
package cokr.xit.fims.framework.biz.mng.bbs.service.bean;
import cokr.xit.foundation.component.AbstractServiceBean;
import cokr.xit.fims.framework.biz.cmm.XitTmplatInfoVO;
import cokr.xit.fims.framework.biz.cmm.service.XitFrameCrudService;
import cokr.xit.fims.framework.biz.mng.bbs.dao.XitBbsTmplateMngMapper;
import cokr.xit.fims.framework.biz.mng.bbs.XitBbsTmplateMngSearchVO;
import cokr.xit.fims.framework.biz.mng.bbs.XitBbsTmplateMngVO;
import cokr.xit.fims.framework.biz.mng.bbs.service.XitBbsTmplateMngService;
import org.springframework.context.support.ReloadableResourceBundleMessageSource;
import org.egovframe.rte.fdl.cmmn.exception.FdlException;
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 XitBbsTmplateMngServiceBean extends AbstractServiceBean implements XitBbsTmplateMngService {
@Resource
private XitBbsTmplateMngMapper xitBbsTmplateMngMapper;
@Resource
private XitFrameCrudService xitFrameCrudService;
@Override
public List<XitBbsTmplateMngVO> findList(XitBbsTmplateMngSearchVO searchVO) {
List<XitBbsTmplateMngVO> result = null;
try {
result = xitBbsTmplateMngMapper.findList(searchVO);
} catch (SQLException e) {
throw new RuntimeException("게시판템플릿관리 목록 조회 FAIL::", e);
}
return result;
}
@Override
public int findListTotCnt(XitBbsTmplateMngSearchVO searchVO) {
int result = 0;
try {
result = xitBbsTmplateMngMapper.findListTotCnt(searchVO);
} catch (SQLException e) {
throw new RuntimeException("게시판템플릿관리 목록 총건수 조회 FAIL::", e);
}
return result;
}
@Override
public XitBbsTmplateMngVO findView(XitBbsTmplateMngVO vo) {
XitBbsTmplateMngVO result = null;
try {
result = xitBbsTmplateMngMapper.findView(vo);
} catch (SQLException e) {
throw new RuntimeException("게시판템플릿관리 상세정보 조회 FAIL::", e);
}
return result;
}
@Override
public void addProc(XitBbsTmplateMngVO vo) {
/**
*
*/
String tmplatId = null;
tmplatId = "nextstringid";
vo.setTmplatId(tmplatId);
XitTmplatInfoVO tmplatInfoVO = convertToCrudVO(vo);
tmplatInfoVO.setRgtr(vo.getRgtr());
/**
*
*/
xitFrameCrudService.addXitTmplatInfo(tmplatInfoVO);
}
@Override
public void modifyProc(XitBbsTmplateMngVO vo) {
/**
*
*/
XitTmplatInfoVO tmplatInfoVO = convertToCrudVO(vo);
tmplatInfoVO.setMdfr(vo.getMdfr());
/**
*
*/
xitFrameCrudService.modifyXitTmplatInfo(tmplatInfoVO);
}
@Override
public void removeProc(XitBbsTmplateMngVO vo) {
/**
*
*/
XitTmplatInfoVO tmplatInfoVO = convertToCrudVO(vo);
tmplatInfoVO.setMdfr(vo.getMdfr());
tmplatInfoVO.setUseYn("N");
/**
*
*/
xitFrameCrudService.modifyXitTmplatInfo(tmplatInfoVO);
}
@Override
public void removesProc(String ids, String userId) {
/**
*
*/
String [] codeIds = ids.split(";");
for(int i=0; i<codeIds.length;i++) {
XitBbsTmplateMngVO vo = new XitBbsTmplateMngVO();
vo.setTmplatId(codeIds[i]);
vo.setMdfr(userId);
this.removeProc(vo);
}
}
/**
* <pre>
* : VO CRUD Service VO .
* </pre>
*
* @return XitTmplatInfoVO
* @author:
* @date: 2020. 4. 16.
*/
private XitTmplatInfoVO convertToCrudVO(XitBbsTmplateMngVO vo) {
XitTmplatInfoVO crudVO = new XitTmplatInfoVO();
crudVO.setTmplatId(vo.getTmplatId()); //템플릿 id
crudVO.setTmplatNm(vo.getTmplatNm()); //템플릿 명
crudVO.setTmplatCours(vo.getTmplatCours()); //템플릿 경로
crudVO.setUseYn(vo.getUseYn()); //사용 여부
crudVO.setTmplatSeCode(vo.getTmplatSeCode()); //템플릿 구분 코드
return crudVO;
}
}

@ -1,145 +0,0 @@
package cokr.xit.fims.framework.biz.mng.bbs.service.bean;
import cokr.xit.foundation.component.AbstractServiceBean;
import cokr.xit.fims.framework.biz.cmm.XitBbsPrcuseVO;
import cokr.xit.fims.framework.biz.cmm.service.XitFrameCrudService;
import cokr.xit.fims.framework.biz.mng.bbs.dao.XitBbsUseMngMapper;
import cokr.xit.fims.framework.biz.mng.bbs.XitBbsUseMngSearchVO;
import cokr.xit.fims.framework.biz.mng.bbs.XitBbsUseMngVO;
import cokr.xit.fims.framework.biz.mng.bbs.service.XitBbsUseMngService;
import org.springframework.context.support.ReloadableResourceBundleMessageSource;
import cokr.xit.fims.framework.core.utils.XitCmmnUtil;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.sql.SQLException;
import java.util.List;
@Service
public class XitBbsUseMngServiceBean extends AbstractServiceBean implements XitBbsUseMngService{
@Resource
private XitBbsUseMngMapper xitBbsUseMngMapper;
@Resource
private XitFrameCrudService xitFrameCrudService;
@Override
public List<XitBbsUseMngVO> findList(XitBbsUseMngSearchVO searchVO) {
List<XitBbsUseMngVO> result = null;
try {
result = xitBbsUseMngMapper.findList(searchVO);
} catch (SQLException e) {
throw new RuntimeException("게시판사용관리 목록 조회 FAIL::", e);
}
return result;
}
@Override
public int findListTotCnt(XitBbsUseMngSearchVO searchVO) {
int result = 0;
try {
result = xitBbsUseMngMapper.findListTotCnt(searchVO);
} catch (SQLException e) {
throw new RuntimeException("게시판사용관리 목록 총건수 조회 FAIL::", e);
}
return result;
}
@Override
public XitBbsUseMngVO findView(XitBbsUseMngVO vo) {
XitBbsUseMngVO result = null;
try {
result = xitBbsUseMngMapper.findView(vo);
} catch (SQLException e) {
throw new RuntimeException("게시판사용관리 상세정보 조회 FAIL::", e);
}
return result;
}
@Override
public void addProc(XitBbsUseMngVO vo) {
/**
*
*/
XitBbsPrcuseVO bbsPrcuseVO = convertToCrudVO(vo);
bbsPrcuseVO.setRgtr(vo.getRgtr());
/**
*
*/
if(XitCmmnUtil.isEmpty(xitFrameCrudService.findXitBbsPrcuse(bbsPrcuseVO))) {
xitFrameCrudService.addXitBbsPrcuse(bbsPrcuseVO);
}else {
vo.setMdfr(vo.getRgtr());
this.modifyProc(vo);
}
}
@Override
public void modifyProc(XitBbsUseMngVO vo) {
/**
*
*/
XitBbsPrcuseVO bbsPrcuseVO = convertToCrudVO(vo);
bbsPrcuseVO.setMdfr(vo.getMdfr());
/**
*
*/
xitFrameCrudService.modifyXitBbsPrcuse(bbsPrcuseVO);
}
@Override
public void removeProc(XitBbsUseMngVO vo) {
/**
*
*/
XitBbsPrcuseVO bbsPrcuseVO = new XitBbsPrcuseVO();
bbsPrcuseVO.setTrgetId(vo.getTrgetId());
bbsPrcuseVO.setBbsId(vo.getBbsId());
bbsPrcuseVO.setMdfr(vo.getMdfr());
bbsPrcuseVO.setUseYn("N");
/**
*
*/
xitFrameCrudService.modifyXitBbsPrcuse(bbsPrcuseVO);
}
@Override
public void removesProc(String ids, String userId) {
// /**
// * 처리
// */
// String [] codeIds = ids.split(";");
// for(int i=0; i<codeIds.length;i++) {
// XitBbsUseMngVO vo = new XitBbsUseMngVO();
// vo.setGrpId(codeIds[i]);
// vo.setMdfr(userId);
// this.removeProc(vo);
// }
}
/**
* <pre>
* : VO CRUD Service VO .
* </pre>
*
* @return XitBbsPrcuseVO
* @author:
* @date: 2020. 4. 16.
*/
private XitBbsPrcuseVO convertToCrudVO(XitBbsUseMngVO vo) {
XitBbsPrcuseVO crudVO = new XitBbsPrcuseVO();
crudVO.setTrgetId(vo.getTrgetId()); //대상 id
crudVO.setBbsId(vo.getBbsId()); //게시판 id
crudVO.setUseYn(vo.getUseYn()); //사용 여부
crudVO.setRegistSeCode(vo.getRegistSeCode()); //등록 구분 코드
return crudVO;
}
}

@ -1,93 +0,0 @@
package cokr.xit.fims.framework.biz.mng.bbs.web;
import cokr.xit.foundation.web.AbstractController;
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.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 java.util.Map;
/**
*
* @: Controller
* @:
* @: 2020. 4. 16. 9:39:52
* @:
* @author ()
* @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
@RequiredArgsConstructor
@Controller
@RequestMapping(name = "", value = "/framework/biz/mng/bbs")
public class BoardBasicMgtController extends AbstractController {
private final BoardBasicMgtService service;
private final CmmFileService fileService;
@RequestMapping(name = "", value = "/mngBoardBasicMgtForm")
public ModelAndView mngBoardBasicMgtForm(@RequestParam final Map<String, Object> paraMap){
ModelAndView mav = new ModelAndView();
mav.addObject("boardMaster", service.findBoardMaster(paraMap));
return mav;
}
@RequestMapping(name = "", value = "/mngBoardBasicMgtPopup")
public ModelAndView mngBoardBasicMgtPopup(final XitBasicBbsMngVO vo) {
ModelAndView mav = new ModelAndView();
if(Checks.isNotEmpty(vo) && Checks.isNotEmpty(vo.getNttSj())){
mav.addObject("boardBasic", service.findBoardBasic(vo));
} else {
mav.addObject("boardBasic", vo);
}
mav.addObject("pageTitle", "게시판 등록 / 변경");
mav.setViewName(FrameworkConstants.FRAMEWORK_JSP_BASE_PATH + "mng/bbs/mngBoardBasicMgtPopup.popup");
return mav;
}
@GetMapping(name = "", value = "/findBoardBasics")
public ModelAndView finsBoardBasics(@RequestParam final Map<String, Object> paraMap){
return new ModelAndView("jsonView").addObject("result",service.findBoardBasicList(paraMap, MybatisUtils.getPagingInfo(paraMap)));
}
@PostMapping(name = "", value = "/addBoardBasic")//, consumes = "multipart/form-data"
public ModelAndView addBoardBasic(final XitBasicBbsMngVO vo, final BindingResult bindingResult){
ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
ValidationError.of("boardBasic", vo, bindingResult);
service.addBoardBasic(vo);
AjaxMessageMapRenderer.success(mav, MessageKey.CMM_INSERT_SUCCESS);
return mav;
}
@PostMapping(name = "", value = "/modifyBoardBasic")
public ModelAndView modifyBoardBasic(final XitBasicBbsMngVO vo, final BindingResult bindingResult){
ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
ValidationError.of("boardBasic", vo, bindingResult);
service.modifyBoardBasic(vo);
AjaxMessageMapRenderer.success(mav, MessageKey.CMM_UPDATE_SUCCESS);
return mav;
}
@RequestMapping(name = "", value = "/findCmmBoardAttchFiles")
public ModelAndView findCmmBoardAttchFiles(final String atchFileId) {
return new ModelAndView("jsonView").addObject("result",fileService.findFiles(atchFileId));
}
}

@ -1,97 +0,0 @@
package cokr.xit.fims.framework.biz.mng.bbs.web;
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.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 java.util.Map;
/**
*
* @: Controller
* @:
* @: 2020. 4. 16. 9:39:52
* @:
* @author ()
* @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
@RequiredArgsConstructor
@Controller
@RequestMapping(name = "", value = "/framework/biz/mng/bbs")
public class BoardCreateMgtController extends AbstractController {
private final BoardCreateMgtService service;
@RequestMapping(name = "", value = "/mngBoardCreateSchPopup")
public ModelAndView mngBoardCreateSchPopup(@RequestParam final Map<String, Object> paraMap){
ModelAndView mav = new ModelAndView();
mav.addAllObjects(paraMap);
mav.addObject("pageTitle","템플릿 조회");
mav.setViewName(FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/bbs/mngBoardCreateSchPopup.popup");
return mav;
}
@RequestMapping(name = "", value = "/mngBoardCreateMgtPopup")
public ModelAndView mngBoardCreateMgtPopup(final XitBbsCreateMngVO vo) {
ModelAndView mav = new ModelAndView();
if(Checks.isNotEmpty(vo) && Checks.isNotEmpty(vo.getBbsId())){
mav.addObject("boardMaster", service.findBoardCreate(vo));
} else {
mav.addObject("boardMaster", vo);
}
mav.addObject("pageTitle", "게시판 템플릿 등록 / 변경");
mav.setViewName(FrameworkConstants.FRAMEWORK_JSP_BASE_PATH + "mng/bbs/mngBoardCreateMgtPopup.popup");
return mav;
}
@GetMapping(name = "", value = "/findBoardCreates")
public ModelAndView finsBoardCreates(@RequestParam final Map<String, Object> paraMap){
return new ModelAndView("jsonView").addObject("result",service.findBoardCreateList(paraMap, MybatisUtils.getPagingInfo(paraMap)));
}
@PostMapping(name = "", value = "/addBoardCreate")
public ModelAndView addBoardCreate(final XitBbsCreateMngVO vo, final BindingResult bindingResult){
ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
ValidationError.of("boardMaster", vo, bindingResult);
service.addBoardCreate(vo);
AjaxMessageMapRenderer.success(mav, MessageKey.CMM_INSERT_SUCCESS);
return mav;
}
@PostMapping(name = "", value = "/modifyBoardCreate")
public ModelAndView modifyBoardCreate(final XitBbsCreateMngVO vo, final BindingResult bindingResult){
ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
ValidationError.of("boardMaster", vo, bindingResult);
service.modifyBoardCreate(vo);
AjaxMessageMapRenderer.success(mav, MessageKey.CMM_UPDATE_SUCCESS);
return mav;
}
@PostMapping(name = "", value = "/removeBoardCreate")
public ModelAndView removeBoardCreate(final XitBbsCreateMngVO vo){
ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
service.removeBoardCreate(vo);
AjaxMessageMapRenderer.success(mav, MessageKey.CMM_DELETE_SUCCESS);
return mav;
}
}

@ -1,158 +0,0 @@
package cokr.xit.fims.framework.biz.mng.bbs.web;
import cokr.xit.foundation.web.AbstractController;
import cokr.xit.fims.framework.biz.mng.bbs.XitBasicBbsMngVO;
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.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.beans.factory.annotation.Value;
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 java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
*
* @: 릿 Controller
* @:
* @: 2020. 4. 16. 9:39:52
* @:
* @author ()
* @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
@RequiredArgsConstructor
@Controller
@RequestMapping(name = "", value = "/framework/biz/mng/bbs/")
public class BoardTmplMgtController extends AbstractController {
private final BoardTmplMgtService service;
private int PAGE_UNIT = 10;
private int PAGE_SIZE = 10;
@RequestMapping(name = "", value = "/mngBoardTmplMgtPopup")
public ModelAndView mngBoardTmplMgtPopup(final XitBbsTmplateMngVO vo) {
ModelAndView mav = new ModelAndView();
if(Checks.isEmpty(vo.getTmplatId())){
mav.addObject("templateInf", vo);
mav.addObject("pageTitle", "게시판 템플릿 등록");
} else {
mav.addObject("templateInf", service.findBoardTmpl(vo));
mav.addObject("pageTitle", "게시판 템플릿 변경");
}
mav.setViewName(FrameworkConstants.FRAMEWORK_JSP_BASE_PATH + "mng/bbs/mngBoardTmplMgtPopup.popup");
return mav;
}
@RequestMapping(name = "", value = "/mngBoardTmplPreviewPopup")
public ModelAndView mngBoardTmplPreviewPopup(@RequestParam Map<String,Object> paraMap) {
XitBbsCreateMngVO master = null;
//String template = vo.getSearchWrd();; // 템플릿 URL
master = new XitBbsCreateMngVO();
master.setBbsNm("미리보기 게시판");
XitBasicBbsMngVO target = null;
List<XitBasicBbsMngVO> list = new ArrayList<XitBasicBbsMngVO>();
target = new XitBasicBbsMngVO();
target.setNttSj("게시판 기능 설명");
target.setRgtr("ID");
target.setFrstRgtrNm("관리자");
target.setRegDt("2009-01-01");
target.setInqireCo(7);
target.setParnts("0");
target.setReplyAt("N");
target.setReplyLc("0");
target.setUseYn("Y");
list.add(target);
target = new XitBasicBbsMngVO();
target.setNttSj("게시판 부가 기능 설명");
target.setRgtr("ID");
target.setFrstRgtrNm("관리자");
target.setRegDt("2009-01-01");
target.setInqireCo(7);
target.setParnts("0");
target.setReplyAt("N");
target.setReplyLc("0");
target.setUseYn("Y");
list.add(target);
ModelAndView mav = new ModelAndView(FrameworkConstants.FRAMEWORK_JSP_BASE_PATH + "mng/bbs/mngBoardTmplPreviewPopup.popup").addObject("result",list);
mav.addObject("brdMstrVO", master);
mav.addObject("preview", "true");
mav.addAllObjects(paraMap);
mav.addObject("pageTitle", "BBS 템플릿 미리보기");
return mav;
}
@GetMapping(name = "", value = "/findBoardTmpls")
public ModelAndView finsBoardTmpls(@RequestParam final Map<String, Object> paraMap){
return new ModelAndView("jsonView").addObject("result",service.findBoardTmpls(paraMap, MybatisUtils.getPagingInfo(paraMap)));
}
@PostMapping(name = "", value = "/addBoardTmpl")
public ModelAndView addBoardTmpl(final XitBbsTmplateMngVO vo, BindingResult bindingResult){
ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
ValidationError.of("templateInf", vo, bindingResult);
service.addBoardTmpl(vo);
AjaxMessageMapRenderer.success(mav, MessageKey.CMM_INSERT_SUCCESS);
return mav;
}
@PostMapping(name = "", value = "/modifyBoardTmpl")
public ModelAndView modifyBoardTmpl(final XitBbsTmplateMngVO vo, BindingResult bindingResult){
ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
ValidationError.of("templateInf", vo, bindingResult);
service.modifyBoardTmpl(vo);
AjaxMessageMapRenderer.success(mav, MessageKey.CMM_UPDATE_SUCCESS);
return mav;
}
@PostMapping(name = "", value = "/removeBoardTmpl")
public ModelAndView removeBoardTmpl(final XitBbsTmplateMngVO vo){
ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
service.removeBoardTmpl(vo);
AjaxMessageMapRenderer.success(mav, MessageKey.CMM_DELETE_SUCCESS);
return mav;
}
}

@ -1,83 +0,0 @@
package cokr.xit.fims.framework.biz.mng.bbs.web;
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.support.mybatis.MybatisUtils;
import cokr.xit.fims.framework.support.util.AjaxMessageMapRenderer;
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 java.util.Map;
@RequiredArgsConstructor
@Controller
@RequestMapping(name = "", value = "/framework/biz/mng/bbs")
public class BoardUseMgtController extends AbstractController {
private final BoardUseMgtService service;
@RequestMapping(name = "", value = "/mngBoardUseMgtPopup")
public ModelAndView mngBoardUseMgtPopup(final XitBbsUseMngVO vo) {
ModelAndView mav = new ModelAndView();
mav.addObject("boardUseInf", vo);
mav.addObject("pageTitle", "게시판 사용 등록 / 변경");
mav.setViewName(FrameworkConstants.FRAMEWORK_JSP_BASE_PATH + "mng/bbs/mngBoardUseMgtPopup.popup");
return mav;
}
@GetMapping(name = "", value = "/findBoardUsePrcuseList")
public ModelAndView finsBoardUsePrcuseList(@RequestParam final Map<String, Object> paraMap){
return new ModelAndView("jsonView").addObject("result",service.findBoardPrcuseList(paraMap, MybatisUtils.getPagingInfo(paraMap)));
}
@PostMapping(name = "", value = "/addBoardUsePrcuse")
public ModelAndView addBoardUsePrcuse(final XitBbsUseMngVO vo, String bbsType, final BindingResult bindingResult){
ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
// CMMNTY 06/CLUB 05/SYSTEM(REGC01)
if ("CMMNTY".equals(bbsType)) {
vo.setRegistSeCode("REGC06");
} else if ("CLUB".equals(bbsType)) {
vo.setRegistSeCode("REGC05");
} else {
vo.setRegistSeCode("REGC01");
}
ValidationError.of("boardUseInf", vo, bindingResult);
service.addBoardPrcuse(vo);
AjaxMessageMapRenderer.success(mav, MessageKey.CMM_INSERT_SUCCESS);
return mav;
}
@PostMapping(name = "", value = "/modifyBoardUsePrcuse")
public ModelAndView modifyBoardUsePrcuse(final XitBbsUseMngVO vo, final BindingResult bindingResult){
ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
ValidationError.of("boardUseInf", vo, bindingResult);
service.modifyBoardPrcuse(vo);
AjaxMessageMapRenderer.success(mav, MessageKey.CMM_UPDATE_SUCCESS);
return mav;
}
@PostMapping(name = "", value = "/removeBoardUsePrcuse")
public ModelAndView removeBoardUsePrcuse(final XitBbsUseMngVO vo){
ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
service.removeBoardPrcuse(vo);
AjaxMessageMapRenderer.success(mav, MessageKey.CMM_DELETE_SUCCESS);
return mav;
}
}

@ -1,685 +0,0 @@
package cokr.xit.fims.framework.biz.mng.bbs.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.cmm.service.XitFrameCrudService;
import cokr.xit.fims.framework.biz.cmm.service.XitFrameUnitService;
import cokr.xit.fims.framework.biz.mng.bbs.XitBasicBbsMngSearchVO;
import cokr.xit.fims.framework.biz.mng.bbs.XitBasicBbsMngVO;
import cokr.xit.fims.framework.biz.mng.bbs.XitBbsCreateMngVO;
import cokr.xit.fims.framework.biz.mng.bbs.service.XitBasicBbsMngService;
import cokr.xit.fims.framework.biz.mng.bbs.service.XitBbsCreateMngService;
import cokr.xit.fims.framework.core.constants.FrameworkConstants;
import cokr.xit.fims.framework.core.XitAttachFileRespVO;
import org.springframework.context.support.ReloadableResourceBundleMessageSource;
import cokr.xit.fims.framework.core.utils.XitCmmnUtil;
import cokr.xit.fims.framework.core.utils.attachfile.XitAttachFileOptionVO;
import cokr.xit.fims.framework.core.utils.attachfile.XitAttachFileUtil;
import cokr.xit.fims.framework.core.utils.attachfile.XitAttachFileVO;
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.beans.factory.annotation.Value;
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.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
*
* @: () Controller
* @:
* @: 2020. 4. 16. 9:39:52
* @:
* @author ()
* @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
@Controller
@RequestMapping(name = "", value = "/framework/biz/mng/bbs/")
public class XitBasicBbsMngController extends AbstractController {
@Resource
private XitBasicBbsMngService xitBasicBbsMngService;
@Resource
private XitFrameCodeService xitFrameCodeService;
@Resource
private XitBbsCreateMngService xitBbsCreateMngService;
@Resource
private XitFrameUnitService xitFrameUnitService;
@Resource
private XitFrameCrudService xitFrameCrudService;
private int PAGE_UNIT = 10;
private int PAGE_SIZE = 10;
private String FILE_UPLOAD_PATH="/xitframe/file/user/upload/";
/**
* <pre> : () </pre>
* @return String
* @author:
* @date: 2020. 4. 16.
*/
@RequestMapping(name = "", value = "BasicBbsMng_{bbsId}_list", method={RequestMethod.GET, RequestMethod.POST})
public String BasicBbsMng_list(@ModelAttribute("searchVO") XitBasicBbsMngSearchVO searchVO, ModelMap model
,@PathVariable String bbsId
) {
XitLoginVO loginVO = (XitLoginVO) EgovUserDetailsHelper.getAuthenticatedUser();
XitBbsCreateMngVO bbsCreateMngVO = new XitBbsCreateMngVO();
bbsCreateMngVO.setBbsId(searchVO.getBbsId());
bbsCreateMngVO.setUniqId(loginVO.getUniqId());
XitBbsCreateMngVO master = xitBbsCreateMngService.findView(bbsCreateMngVO);
//-------------------------------
// 방명록이면 방명록 URL로 forward
//-------------------------------
if (master.getBbsTyCode().equals("BBST04")) {
return "forward:/cop/bbs/selectGuestList";
}
////-----------------------------
searchVO.setPageUnit(PAGE_UNIT);
searchVO.setPageSize(PAGE_SIZE);
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());
searchVO.setAttrbFlag(bbsCreateMngVO.getBbsAttrbCode());
List<XitBasicBbsMngVO> resultList = xitBasicBbsMngService.findList(searchVO);
int totCnt = xitBasicBbsMngService.findListTotCnt(searchVO);
paginationInfo.setTotalRecordCount(totCnt);
//-------------------------------
// 기본 BBS template 지정
//-------------------------------
if (master.getTmplatCours() == null || master.getTmplatCours().equals("")) {
master.setTmplatCours("/resources/css/egovframework/cop/bbs/egovBaseTemplate.css");
}
////-----------------------------
model.addAttribute("resultList", resultList);
model.addAttribute("resultCnt", totCnt);
model.addAttribute("boardVO", searchVO);
model.addAttribute("brdMstrVO", master);
model.addAttribute("paginationInfo", paginationInfo);
return FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/bbs/XitBasicBbsMng_list";
}
/**
* <pre> : () </pre>
* @return String
* @author:
* @date: 2020. 9. 11.
*/
@RequestMapping(name = "", value = "BasicBbsMng_{bbsId}_list.do", method={RequestMethod.GET, RequestMethod.POST})
@ResponseBody
public Map<String, Object> BasicBbsMng_listAjax(@ModelAttribute("searchVO") XitBasicBbsMngSearchVO searchVO, ModelMap model
,@PathVariable String bbsId
) {
/** 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 = xitBasicBbsMngService.findListTotCnt(searchVO);
paginationInfo.setTotalRecordCount(totCnt);
/**
*
*/
/* ***************************
* tui Grid Response Set
*************************** */
resultMap.put("result", true); //[tui Grid] result
resultMap.put("message", "정상적으로 조회 되었습니다."); //[tui Grid] result message
Map<String, Object> data = new HashMap<String, Object>();
data.put("contents", xitBasicBbsMngService.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", "조회에 실패하였습니다."); //[tui Grid] result message
}
return resultMap;
}
/**
* <pre> : .</pre>
* @param cmd String
* @param model
* @return String
* @author:
* @date: 2020. 4. 16.
*/
@RequestMapping(name = "", value = "BasicBbsMng_{bbsId}_{cmd}", method={RequestMethod.GET, RequestMethod.POST})
public String BasicBbsMng_page(@PathVariable String cmd
, @ModelAttribute("vo") XitBasicBbsMngVO vo
, @ModelAttribute("searchVO") XitBasicBbsMngSearchVO searchVO
, ModelMap model
, @PathVariable String bbsId
) {
XitLoginVO loginVO = (XitLoginVO) EgovUserDetailsHelper.getAuthenticatedUser();
XitBasicBbsMngVO result = null;
XitBbsCreateMngVO bbsCreateMngVO = null;
XitBbsCreateMngVO master = null;
switch (cmd) {
case "input": //등록 페이지
case "inputReply": //답글 등록 페이지
/* **********************
*
********************** */
bbsCreateMngVO = new XitBbsCreateMngVO();
bbsCreateMngVO.setBbsId(searchVO.getBbsId());
bbsCreateMngVO.setUniqId(loginVO.getUniqId());
master = xitBbsCreateMngService.findView(bbsCreateMngVO);
model.addAttribute("bdMstr", master);
model.addAttribute("result", vo);
//----------------------------
// 기본 BBS template 지정
//----------------------------
if (master.getTmplatCours() == null || master.getTmplatCours().equals("")) {
master.setTmplatCours("/resources/css/egovframework/cop/bbs/egovBaseTemplate.css");
}
model.addAttribute("brdMstrVO", master);
////-----------------------------
break;
case "edit": //수정 페이지
/* **********************
*
********************** */
result = xitBasicBbsMngService.findView(vo);
model.addAttribute("result", result);
/* **********************
*
********************** */
bbsCreateMngVO = new XitBbsCreateMngVO();
bbsCreateMngVO.setBbsId(searchVO.getBbsId());
bbsCreateMngVO.setUniqId(loginVO.getUniqId());
master = xitBbsCreateMngService.findView(bbsCreateMngVO);
model.addAttribute("bdMstr", master);
//----------------------------
// 기본 BBS template 지정
//----------------------------
if (master.getTmplatCours() == null || master.getTmplatCours().equals("")) {
master.setTmplatCours("/resources/css/egovframework/cop/bbs/egovBaseTemplate.css");
}
model.addAttribute("brdMstrVO", master);
break;
case "view": //상세 페이지
/* **********************
*
********************** */
// 조회수 증가 여부 지정
vo.setPlusCount(true);
if (XitCmmnUtil.notEmpty(vo.getSubPageIndex())) {
vo.setPlusCount(false);
}
////-------------------------------
vo.setMdfr(loginVO.getUniqId());
result = xitBasicBbsMngService.findView(vo);
model.addAttribute("result", result);
model.addAttribute("sessionUniqId", loginVO.getUniqId());
/* **********************
*
********************** */
bbsCreateMngVO = new XitBbsCreateMngVO();
bbsCreateMngVO.setBbsId(searchVO.getBbsId());
bbsCreateMngVO.setUniqId(loginVO.getUniqId());
master = xitBbsCreateMngService.findView(bbsCreateMngVO);
//----------------------------
// template 처리 (기본 BBS template 지정 포함)
//----------------------------
if (master.getTmplatCours() == null || master.getTmplatCours().equals("")) {
master.setTmplatCours("/resources/css/egovframework/cop/bbs/egovBaseTemplate.css");
}
model.addAttribute("brdMstrVO", master);
break;
case "preview": //미리보기 게시판
String template = searchVO.getSearchWrd(); // 템플릿 URL
master = new XitBbsCreateMngVO();
master.setBbsNm("미리보기 게시판");
searchVO.setPageUnit(PAGE_UNIT);
searchVO.setPageSize(PAGE_SIZE);
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());
XitBasicBbsMngVO target = null;
List<XitBasicBbsMngVO> list = new ArrayList<XitBasicBbsMngVO>();
target = new XitBasicBbsMngVO();
target.setNttSj("게시판 기능 설명");
target.setRgtr("ID");
target.setFrstRgtrNm("관리자");
target.setRegDt("2009-01-01");
target.setInqireCo(7);
target.setParnts("0");
target.setReplyAt("N");
target.setReplyLc("0");
target.setUseYn("Y");
list.add(target);
target = new XitBasicBbsMngVO();
target.setNttSj("게시판 부가 기능 설명");
target.setRgtr("ID");
target.setFrstRgtrNm("관리자");
target.setRegDt("2009-01-01");
target.setInqireCo(7);
target.setParnts("0");
target.setReplyAt("N");
target.setReplyLc("0");
target.setUseYn("Y");
list.add(target);
searchVO.setSearchWrd("");
int totCnt = list.size();
paginationInfo.setTotalRecordCount(totCnt);
master.setTmplatCours(template);
model.addAttribute("resultList", list);
model.addAttribute("resultCnt", Integer.toString(totCnt));
model.addAttribute("boardVO", searchVO);
model.addAttribute("brdMstrVO", master);
model.addAttribute("paginationInfo", paginationInfo);
model.addAttribute("preview", "true");
cmd = "list";
break;
default:
throw new RuntimeException("유효하지 않은 요청 입니다.");
}
return FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/bbs/XitBasicBbsMng_"+cmd;
}
/**
* <pre> : .</pre>
* @param cmd
* @param model
* @return String
* @author:
* @date: 2020. 4. 16.
*/
@RequestMapping(name = "", value = "BasicBbsMng_{cmd}_popup", method={RequestMethod.GET, RequestMethod.POST})
public String BasicBbsMng_page_popup(@PathVariable String cmd
, @ModelAttribute XitBasicBbsMngSearchVO searchVO
, @ModelAttribute XitBasicBbsMngVO vo, ModelMap model) {
switch (cmd) {
case "": //
break;
default:
throw new RuntimeException("유효하지 않은 요청 입니다.");
}
return FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/bbs/XitBasicBbsMng_"+cmd+"_popup";
}
/**
* <pre> : () CUD </pre>
* @return String
* @author:
* @throws IOException
* @throws ServletException
* @date: 2020. 4. 16.
*/
@RequestMapping(name = "", value = "BasicBbsMng_{cmd}_proc", method=RequestMethod.POST)
public void BasicBbsMng_cmd_proc(HttpServletRequest req
,@PathVariable String cmd
,@ModelAttribute("vo") XitBasicBbsMngVO vo
,@ModelAttribute("searchVO") XitBasicBbsMngSearchVO searchVO
,@RequestParam(value="codeIds", required=false, defaultValue="") String codeIds
,BindingResult bindingResult
,SessionStatus status
,Model model
,HttpServletRequest request
,HttpServletResponse response
) throws ServletException, IOException {
/**
*
*/
XitLoginVO loginVO = (XitLoginVO) EgovUserDetailsHelper.getAuthenticatedUser();
String sLocationUrl = "forward:/framework/biz/mng/bbs/BasicBbsMng_"+vo.getBbsId()+"_list";
String message = null;
/* ----------------------
*
---------------------- */
String uploadPath = XitCmmnUtil.setOsPath(FILE_UPLOAD_PATH); //파일업로드 경로
XitAttachFileOptionVO optionVO = new XitAttachFileOptionVO(); //파일업로드 옵션
List<XitAttachFileVO> listAttachFileVO = null; //파일업로드된 파일목록
XitAttachFileRespVO attachFileVO = null; //첨부파일 DB 처리 결과목록
switch (cmd) {
case "insert": //등록
if (bindingResult.hasErrors()) {
message = "생성에 실패하였습니다.";
sLocationUrl = "forward:/framework/biz/mng/bbs/BasicBbsMng_"+vo.getBbsId()+"_input";
break;
}
//첨부파일 업로드
optionVO.setFileNmMask(true); //파일명 마스킹 여부
optionVO.setFileNmMaskPrefix("BBS_"); //파일명 마스킹 prefix 문자
try {
listAttachFileVO = XitAttachFileUtil.fileUpload(req, uploadPath, optionVO);
} catch (Exception e) {
throw new RuntimeException(String.format("file upload fail:::%s", e.getMessage()));
}
//처리
try {
//첨부파일 DB 등록
String atchFileId = null;
if(XitCmmnUtil.notEmpty(listAttachFileVO)) {
attachFileVO = xitFrameUnitService.addAttachFileInfo(listAttachFileVO);
atchFileId = attachFileVO.getAtchFileId();
}
//게시물 등록
vo.setAtchFileId(atchFileId); //첨부파일ID
vo.setNttCn(this.unscript(vo.getNttCn())); //XSS 방지
vo.setRgtr(loginVO.getUniqId());
xitBasicBbsMngService.addProc(vo);
status.setComplete();
message = "정상적으로 등록 되었습니다.";
} catch (RuntimeException e) {
message = e.getMessage();
sLocationUrl = "forward:/framework/biz/mng/bbs/BasicBbsMng_"+vo.getBbsId()+"_input";
} catch (Exception e) {
message = "생성에 실패하였습니다.";
sLocationUrl = "forward:/framework/biz/mng/bbs/BasicBbsMng_"+vo.getBbsId()+"_input";
}
break;
// case "inserts": //다건 등록
// break;
case "insertReply": //답글 등록
if (bindingResult.hasErrors()) {
message = "생성에 실패하였습니다.";
sLocationUrl = "forward:/framework/biz/mng/bbs/BasicBbsMng_"+vo.getBbsId()+"_input";
break;
}
//첨부파일 업로드
optionVO.setFileNmMask(true); //파일명 마스킹 여부
optionVO.setFileNmMaskPrefix("BBS_"); //파일명 마스킹 prefix 문자
try {
listAttachFileVO = XitAttachFileUtil.fileUpload(req, uploadPath, optionVO);
} catch (Exception e) {
throw new RuntimeException(String.format("file upload fail:::%s", e.getMessage()));
}
//처리
try {
//첨부파일 DB 등록
String atchFileId = null;
if(XitCmmnUtil.notEmpty(listAttachFileVO)) {
attachFileVO = xitFrameUnitService.addAttachFileInfo(listAttachFileVO);
atchFileId = attachFileVO.getAtchFileId();
}
//게시물 등록
vo.setReplyAt("Y"); //답글여부
vo.setParnts(vo.getNttId()+""); //부모 게시물ID
vo.setReplyLc(Integer.toString(Integer.parseInt(vo.getReplyLc()) + 1)); //답장위치
vo.setAtchFileId(atchFileId); //첨부파일ID
vo.setNttCn(this.unscript(vo.getNttCn())); //XSS 방지
vo.setRgtr(loginVO.getUniqId());
xitBasicBbsMngService.addProc(vo);
status.setComplete();
message = "정상적으로 등록 되었습니다.";
} catch (RuntimeException e) {
message = e.getMessage();
sLocationUrl = "forward:/framework/biz/mng/bbs/BasicBbsMng_"+vo.getBbsId()+"_input";
} catch (Exception e) {
message = "생성에 실패하였습니다.";
sLocationUrl = "forward:/framework/biz/mng/bbs/BasicBbsMng_"+vo.getBbsId()+"_input";
}
break;
case "update": //수정
if (bindingResult.hasErrors()) {
message = "변경에 실패하였습니다.";
sLocationUrl = "forward:/framework/biz/mng/bbs/BasicBbsMng_"+vo.getBbsId()+"_edit";
break;
}
//첨부파일 업로드
optionVO.setFileNmMask(true); //파일명 마스킹 여부
optionVO.setFileNmMaskPrefix("BBS_"); //파일명 마스킹 prefix 문자
try {
listAttachFileVO = XitAttachFileUtil.fileUpload(req, uploadPath, optionVO);
} catch (Exception e) {
throw new RuntimeException(String.format("file upload fail:::%s", e.getMessage()));
}
//처리
try {
//첨부파일 DB 등록
String atchFileId = null;
if(XitCmmnUtil.notEmpty(listAttachFileVO)) {
//기등록 파일유무에 따라 분기
if(XitCmmnUtil.isEmpty(vo.getAtchFileId())) {
attachFileVO = xitFrameUnitService.addAttachFileInfo(listAttachFileVO);
atchFileId = attachFileVO.getAtchFileId();
}else {
attachFileVO = xitFrameUnitService.addAttachFileInfo(listAttachFileVO, vo.getAtchFileId());
atchFileId = attachFileVO.getAtchFileId();
}
}
//게시물 수정
vo.setAtchFileId(atchFileId); //첨부파일ID
vo.setNttCn(this.unscript(vo.getNttCn())); //XSS 방지
vo.setMdfr(loginVO.getUniqId());
xitBasicBbsMngService.modifyProc(vo);
status.setComplete();
message = "정상적으로 변경 되었습니다.";
sLocationUrl = "forward:/framework/biz/mng/bbs/BasicBbsMng_"+vo.getBbsId()+"_view";
} catch (RuntimeException e) {
message = e.getMessage();
sLocationUrl = "forward:/framework/biz/mng/bbs/BasicBbsMng_"+vo.getBbsId()+"_edit";
} catch (Exception e) {
message = "변경에 실패하였습니다.";
sLocationUrl = "forward:/framework/biz/mng/bbs/BasicBbsMng_"+vo.getBbsId()+"_edit";
}
break;
case "delete": //삭제
//처리
try {
vo.setMdfr(loginVO.getUniqId());
xitBasicBbsMngService.removeProc(vo);
status.setComplete();
message = "정상적으로 삭제 되었습니다.";
break;
} catch (RuntimeException e) {
message = e.getMessage();
sLocationUrl = "forward:/framework/biz/mng/bbs/BasicBbsMng_"+vo.getBbsId()+"_edit";
} catch (Exception e) {
message = "삭제에 실패하였습니다.";
sLocationUrl = "forward:/framework/biz/mng/bbs/BasicBbsMng_"+vo.getBbsId()+"_edit";
}
break;
// case "deletes": //다건 삭제
// //처리
// try {
// xitBasicBbsMngService.removesProc(codeIds, loginVO.getUniqId());
// status.setComplete();
// message = "정상적으로 삭제 되었습니다.";
// } catch (RuntimeException e) {
// message = e.getMessage();
// } catch (Exception e) {
// message = "삭제에 실패하였습니다.";
// }
// break;
default:
new RuntimeException("유효하지 않은 요청 입니다.");
}
/*
CacheServiceUtils.evictBaseBbsList();
CacheServiceUtils.evictBaseBbsList();
*/
/**
*
*/
/* ============================
* 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());
}
}
/**
* XSS .
*
* @param data
* @return
*/
protected String unscript(String data) {
if (data == null || data.trim().equals("")) {
return "framework/egov/";
}
String ret = data;
ret = ret.replaceAll("<(S|s)(C|c)(R|r)(I|i)(P|p)(T|t)", "&lt;script");
ret = ret.replaceAll("</(S|s)(C|c)(R|r)(I|i)(P|p)(T|t)", "&lt;/script");
ret = ret.replaceAll("<(O|o)(B|b)(J|j)(E|e)(C|c)(T|t)", "&lt;object");
ret = ret.replaceAll("</(O|o)(B|b)(J|j)(E|e)(C|c)(T|t)", "&lt;/object");
ret = ret.replaceAll("<(A|a)(P|p)(P|p)(L|l)(E|e)(T|t)", "&lt;applet");
ret = ret.replaceAll("</(A|a)(P|p)(P|p)(L|l)(E|e)(T|t)", "&lt;/applet");
ret = ret.replaceAll("<(E|e)(M|m)(B|b)(E|e)(D|d)", "&lt;embed");
ret = ret.replaceAll("</(E|e)(M|m)(B|b)(E|e)(D|d)", "&lt;embed");
ret = ret.replaceAll("<(F|f)(O|o)(R|r)(M|m)", "&lt;form");
ret = ret.replaceAll("</(F|f)(O|o)(R|r)(M|m)", "&lt;form");
return ret;
}
}

@ -1,375 +0,0 @@
package cokr.xit.fims.framework.biz.mng.bbs.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.bbs.XitBbsCreateMngSearchVO;
import cokr.xit.fims.framework.biz.mng.bbs.XitBbsCreateMngVO;
import cokr.xit.fims.framework.biz.mng.bbs.service.XitBbsCreateMngService;
import cokr.xit.fims.framework.core.constants.FrameworkConstants;
import org.springframework.context.support.ReloadableResourceBundleMessageSource;
import cokr.xit.fims.framework.core.utils.XitCmmnUtil;
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.beans.factory.annotation.Value;
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. 4. 16. 9:39:52
* @:
* @author ()
* @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
@Controller
@RequestMapping(name = "", value = "/framework/biz/mng/bbss/")
public class XitBbsCreateMngController extends AbstractController {
@Resource
private XitBbsCreateMngService xitBbsCreateMngService;
@Resource
private XitFrameCodeService xitFrameCodeService;
private int PAGE_UNIT = 10;
private int PAGE_SIZE = 10;
private String FILE_UPLOAD_SIZE = "5242880";
/**
* <pre> : </pre>
* @return String
* @author:
* @date: 2020. 4. 16.
*/
@RequestMapping(name = "", value = "BbsCreateMng_list", method={RequestMethod.GET, RequestMethod.POST})
public String BbsCreateMng_list(@ModelAttribute("searchVO") XitBbsCreateMngSearchVO searchVO, ModelMap model) {
/** pageing */
searchVO.setPageUnit(PAGE_UNIT);
searchVO.setPageSize(PAGE_SIZE);
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<XitBbsCreateMngVO> resultList = xitBbsCreateMngService.findList(searchVO);
int totCnt = xitBbsCreateMngService.findListTotCnt(searchVO);
paginationInfo.setTotalRecordCount(totCnt);
model.addAttribute("resultList", resultList);
model.addAttribute("resultCnt", totCnt);
model.addAttribute("paginationInfo", paginationInfo);
return FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/bbs/XitBbsCreateMng_list";
}
/**
* <pre> : </pre>
* @return String
* @author:
* @date: 2020. 8. 04.
*/
@RequestMapping(name = "", value = "BbsCreateMng_list.do", method={RequestMethod.GET, RequestMethod.POST})
@ResponseBody
public Map<String, Object> BbsCreateMng_listAjax(@ModelAttribute("searchVO") XitBbsCreateMngSearchVO 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 = xitBbsCreateMngService.findListTotCnt(searchVO);
paginationInfo.setTotalRecordCount(totCnt);
/**
*
*/
/* ***************************
* tui Grid Response Set
*************************** */
resultMap.put("result", true); //[tui Grid] result
resultMap.put("message", "정상적으로 조회 되었습니다."); //[tui Grid] result message
Map<String, Object> data = new HashMap<String, Object>();
data.put("contents", xitBbsCreateMngService.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", "조회에 실패하였습니다."); //[tui Grid] result message
}
return resultMap;
}
/**
* <pre> : .</pre>
* @param cmd
* @param model
* @return String
* @author:
* @date: 2020. 4. 16.
*/
@RequestMapping(name = "", value = "BbsCreateMng_{cmd}", method={RequestMethod.GET, RequestMethod.POST})
public String BbsCreateMng_page(@PathVariable String cmd
, @ModelAttribute("vo") XitBbsCreateMngVO vo
, @ModelAttribute("searchVO") XitBbsCreateMngSearchVO searchVO
, ModelMap model) {
switch (cmd) {
case "input": //등록 페이지
model.addAttribute("typeList", xitFrameCodeService.findCmmnDetailCodes("XIT004"));
model.addAttribute("attrbList", xitFrameCodeService.findCmmnDetailCodes("XIT009"));
model.addAttribute("boardMaster", new XitBbsCreateMngVO());
break;
case "edit": //수정 페이지
case "view": //상세 페이지
model.addAttribute("result", xitBbsCreateMngService.findView(vo));
break;
default:
throw new RuntimeException("유효하지 않은 요청 입니다.");
}
return FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/bbs/XitBbsCreateMng_"+cmd;
}
/**
* <pre> : .</pre>
* @param cmd
* @param model
* @return String
* @author:
* @date: 2020. 4. 16.
*/
@RequestMapping(name = "", value = "BbsCreateMng_{cmd}_popup", method={RequestMethod.GET, RequestMethod.POST})
public String BbsCreateMng_page_popup(@PathVariable String cmd
, @ModelAttribute("searchVO") XitBbsCreateMngSearchVO searchVO
, @ModelAttribute("vo") XitBbsCreateMngVO vo, ModelMap model
, @RequestParam Map<String, Object> commandMap
) {
switch (cmd) {
case "choice": //게시판 선택 팝업
searchVO.setPageUnit(PAGE_UNIT);
searchVO.setPageSize(PAGE_SIZE);
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());
searchVO.setUseYn("Y");
List<XitBbsCreateMngVO> resultList = xitBbsCreateMngService.findList(searchVO);
int totCnt = xitBbsCreateMngService.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/bbs/XitBbsCreateMng_"+cmd+"_popup";
}
/**
* <pre> : CUD </pre>
* @return String
* @author:
* @throws IOException
* @throws ServletException
* @date: 2020. 4. 16.
*/
@RequestMapping(name = "", value = "BbsCreateMng_{cmd}_proc", method=RequestMethod.POST)
public void BbsCreateMng_cmd_proc(@PathVariable String cmd
,@ModelAttribute("vo") XitBbsCreateMngVO vo
,@ModelAttribute("searchVO") XitBbsCreateMngSearchVO searchVO
,@RequestParam(value="codeIds", required=false, defaultValue="") String codeIds
,BindingResult bindingResult
,SessionStatus status
,Model model
,HttpServletRequest request
,HttpServletResponse response
) throws ServletException, IOException {
/**
*
*/
XitLoginVO loginVO = (XitLoginVO) EgovUserDetailsHelper.getAuthenticatedUser();
String sLocationUrl = "forward:/framework/biz/mng/bbs/BbsCreateMng_list";
String message = null;
switch (cmd) {
case "insert": //등록
if (bindingResult.hasErrors()) {
message = "생성에 실패하였습니다.";
sLocationUrl = "forward:/framework/biz/mng/bbs/BbsCreateMng_input";
break;
}
//처리
try {
vo.setTrgetId("SYSTEMDEFAULT_REGIST");
vo.setPosblAtchFileSize(FILE_UPLOAD_SIZE);
vo.setRgtr(loginVO.getUniqId());
xitBbsCreateMngService.addProc(vo);
status.setComplete();
message = "정상적으로 등록 되었습니다.";
} catch (RuntimeException e) {
message = e.getMessage();
sLocationUrl = "forward:/framework/biz/mng/bbs/BbsCreateMng_input";
} catch (Exception e) {
message = "생성에 실패하였습니다.";
sLocationUrl = "forward:/framework/biz/mng/bbs/BbsCreateMng_input";
}
break;
// case "inserts": //다건 등록
// break;
case "update": //수정
if (bindingResult.hasErrors()) {
message = "변경에 실패하였습니다.";
sLocationUrl = "forward:/framework/biz/mng/bbs/BbsCreateMng_edit";
break;
}
//처리
try {
vo.setPosblAtchFileSize(FILE_UPLOAD_SIZE);
vo.setMdfr(loginVO.getUniqId());
xitBbsCreateMngService.modifyProc(vo);
status.setComplete();
message = "정상적으로 변경 되었습니다.";
} catch (RuntimeException e) {
message = e.getMessage();
sLocationUrl = "forward:/framework/biz/mng/bbs/BbsCreateMng_edit";
} catch (Exception e) {
message = "변경에 실패하였습니다.";
sLocationUrl = "forward:/framework/biz/mng/bbs/BbsCreateMng_edit";
}
break;
case "delete": //삭제
//처리
try {
vo.setMdfr(loginVO.getUniqId());
xitBbsCreateMngService.removeProc(vo);
status.setComplete();
message = "정상적으로 삭제 되었습니다.";
break;
} catch (RuntimeException e) {
message = e.getMessage();
sLocationUrl = "forward:/framework/biz/mng/bbs/BbsCreateMng_edit";
} catch (Exception e) {
message = "삭제에 실패하였습니다.";
sLocationUrl = "forward:/framework/biz/mng/bbs/BbsCreateMng_edit";
}
break;
case "deletes": //다건 삭제
//처리
try {
xitBbsCreateMngService.removesProc(codeIds, loginVO.getUniqId());
status.setComplete();
message = "정상적으로 삭제 되었습니다.";
} catch (RuntimeException e) {
message = e.getMessage();
} catch (Exception e) {
message = "삭제에 실패하였습니다.";
}
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,315 +0,0 @@
package cokr.xit.fims.framework.biz.mng.bbs.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.bbs.XitBbsTmplateMngSearchVO;
import cokr.xit.fims.framework.biz.mng.bbs.XitBbsTmplateMngVO;
import cokr.xit.fims.framework.biz.mng.bbs.service.XitBbsTmplateMngService;
import cokr.xit.fims.framework.core.constants.FrameworkConstants;
import org.springframework.context.support.ReloadableResourceBundleMessageSource;
import cokr.xit.fims.framework.core.utils.XitCmmnUtil;
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. 4. 16. 9:39:52
* @:
* @author ()
* @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
@Controller
@RequestMapping(name = "", value = "/framework/biz/mng/bbss/")
public class XitBbsTmplateMngController extends AbstractController {
@Resource
private XitBbsTmplateMngService xitBbsTmplateMngService;
@Resource
private XitFrameCodeService xitFrameCodeService;
/**
* <pre> : 릿 </pre>
* @return String
* @author:
* @date: 2020. 4. 16.
*/
@RequestMapping(name = "", value = "BbsTmplateMng_list", method={RequestMethod.GET, RequestMethod.POST})
public String BbsTmplateMng_list(@ModelAttribute("searchVO") XitBbsTmplateMngSearchVO searchVO, ModelMap model) {
return FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/bbs/XitBbsTmplateMng_list";
}
/**
* <pre> : 릿 </pre>
* @return String
* @author:
* @date: 2020. 8. 04.
*/
@RequestMapping(name = "", value = "BbsTmplateMng_list.do", method={RequestMethod.GET, RequestMethod.POST})
@ResponseBody
public Map<String, Object> BbsTmplateMng_listAjax(@ModelAttribute("searchVO") XitBbsTmplateMngSearchVO 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 = xitBbsTmplateMngService.findListTotCnt(searchVO);
paginationInfo.setTotalRecordCount(totCnt);
/**
*
*/
/* ***************************
* tui Grid Response Set
*************************** */
resultMap.put("result", true); //[tui Grid] result
resultMap.put("message", "정상적으로 조회 되었습니다."); //[tui Grid] result message
Map<String, Object> data = new HashMap<String, Object>();
data.put("contents", xitBbsTmplateMngService.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", "조회에 실패하였습니다."); //[tui Grid] result message
}
return resultMap;
}
/**
* <pre> : .</pre>
* @param cmd
* @param model
* @return String
* @author:
* @date: 2020. 4. 16.
*/
@RequestMapping(name = "", value = "BbsTmplateMng_{cmd}", method={RequestMethod.GET, RequestMethod.POST})
public String BbsTmplateMng_page(@PathVariable String cmd
, @ModelAttribute("vo") XitBbsTmplateMngVO vo
, @ModelAttribute("searchVO") XitBbsTmplateMngSearchVO searchVO
, ModelMap model) {
switch (cmd) {
case "input": //등록 페이지
model.addAttribute("resultList", xitFrameCodeService.findCmmnDetailCodes("XIT005"));
break;
case "edit": //수정 페이지
case "view": //상세 페이지
model.addAttribute("resultList", xitFrameCodeService.findCmmnDetailCodes("XIT005"));
model.addAttribute("TemplateInfVO", xitBbsTmplateMngService.findView(vo));
break;
default:
throw new RuntimeException("유효하지 않은 요청 입니다.");
}
return FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/bbs/XitBbsTmplateMng_"+cmd;
}
/**
* <pre> : .</pre>
* @param cmd
* @param model
* @return String
* @author:
* @date: 2020. 4. 16.
*/
@RequestMapping(name = "", value = "BbsTmplateMng_{cmd}_popup", method={RequestMethod.GET, RequestMethod.POST})
public String BbsTmplateMng_page_popup(@PathVariable String cmd
, @ModelAttribute("searchVO") XitBbsTmplateMngSearchVO searchVO
, @ModelAttribute("vo") XitBbsTmplateMngVO vo, ModelMap model
, @RequestParam Map<String, Object> commandMap
) {
switch (cmd) {
case "choice": //템플릿 선택 팝업
break;
default:
throw new RuntimeException("유효하지 않은 요청 입니다.");
}
return FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/bbs/XitBbsTmplateMng_"+cmd+"_popup";
}
/**
* <pre> : 릿 CUD </pre>
* @return String
* @author:
* @throws IOException
* @throws ServletException
* @date: 2020. 4. 16.
*/
@RequestMapping(name = "", value = "BbsTmplateMng_{cmd}_proc", method=RequestMethod.POST)
public void BbsTmplateMng_cmd_proc(@PathVariable String cmd
,@ModelAttribute("vo") XitBbsTmplateMngVO vo
,@ModelAttribute("searchVO") XitBbsTmplateMngSearchVO searchVO
,@RequestParam(value="codeIds", required=false, defaultValue="") String codeIds
,BindingResult bindingResult
,SessionStatus status
,Model model
,HttpServletRequest request
,HttpServletResponse response
) throws ServletException, IOException {
/**
*
*/
XitLoginVO loginVO = (XitLoginVO) EgovUserDetailsHelper.getAuthenticatedUser();
String sLocationUrl = "forward:/framework/biz/mng/bbs/BbsTmplateMng_list";
String message = null;
switch (cmd) {
case "insert": //등록
if (bindingResult.hasErrors()) {
message = "생성에 실패하였습니다.";
sLocationUrl = "forward:/framework/biz/mng/bbs/BbsTmplateMng_input";
break;
}
//처리
try {
vo.setRgtr(loginVO.getUniqId());
xitBbsTmplateMngService.addProc(vo);
status.setComplete();
message = "정상적으로 등록 되었습니다.";
} catch (RuntimeException e) {
message = e.getMessage();
sLocationUrl = "forward:/framework/biz/mng/bbs/BbsTmplateMng_input";
} catch (Exception e) {
message = "생성에 실패하였습니다.";
sLocationUrl = "forward:/framework/biz/mng/bbs/BbsTmplateMng_input";
}
break;
// case "inserts": //다건 등록
// break;
case "update": //수정
if (bindingResult.hasErrors()) {
message = "변경에 실패하였습니다.";
sLocationUrl = "forward:/framework/biz/mng/bbs/BbsTmplateMng_edit";
break;
}
//처리
try {
vo.setMdfr(loginVO.getUniqId());
xitBbsTmplateMngService.modifyProc(vo);
status.setComplete();
message = "정상적으로 변경 되었습니다.";
} catch (RuntimeException e) {
message = e.getMessage();
sLocationUrl = "forward:/framework/biz/mng/bbs/BbsTmplateMng_edit";
} catch (Exception e) {
message = "변경에 실패하였습니다.";
sLocationUrl = "forward:/framework/biz/mng/bbs/BbsTmplateMng_edit";
}
break;
case "delete": //삭제
//처리
try {
vo.setMdfr(loginVO.getUniqId());
xitBbsTmplateMngService.removeProc(vo);
status.setComplete();
message = "정상적으로 삭제 되었습니다.";
break;
} catch (RuntimeException e) {
message = e.getMessage();
sLocationUrl = "forward:/framework/biz/mng/bbs/BbsTmplateMng_edit";
} catch (Exception e) {
message = "삭제에 실패하였습니다.";
sLocationUrl = "forward:/framework/biz/mng/bbs/BbsTmplateMng_edit";
}
break;
case "deletes": //다건 삭제
//처리
try {
xitBbsTmplateMngService.removesProc(codeIds, loginVO.getUniqId());
status.setComplete();
message = "정상적으로 삭제 되었습니다.";
} catch (RuntimeException e) {
message = e.getMessage();
} catch (Exception e) {
message = "삭제에 실패하였습니다.";
}
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,338 +0,0 @@
package cokr.xit.fims.framework.biz.mng.bbs.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.bbs.XitBbsUseMngSearchVO;
import cokr.xit.fims.framework.biz.mng.bbs.XitBbsUseMngVO;
import cokr.xit.fims.framework.biz.mng.bbs.service.XitBbsUseMngService;
import cokr.xit.fims.framework.core.constants.FrameworkConstants;
import org.springframework.context.support.ReloadableResourceBundleMessageSource;
import cokr.xit.fims.framework.core.utils.XitCmmnUtil;
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. 4. 16. 9:39:52
* @:
* @author ()
* @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
@Controller
@RequestMapping(name = "", value = "/framework/biz/mng/bbss/")
public class XitBbsUseMngController extends AbstractController {
@Resource
private XitBbsUseMngService xitBbsUseMngService;
@Resource
private XitFrameCodeService xitFrameCodeService;
/**
* <pre> : </pre>
* @return String
* @author:
* @date: 2020. 4. 16.
*/
@RequestMapping(name = "", value = "BbsUseMng_list", method={RequestMethod.GET, RequestMethod.POST})
public String BbsUseMng_list(@ModelAttribute("searchVO") XitBbsUseMngSearchVO searchVO, ModelMap model) {
return FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/bbs/XitBbsUseMng_list";
}
/**
* <pre> : </pre>
* @return String
* @author:
* @date: 2020. 8. 04.
*/
@RequestMapping(name = "", value = "BbsUseMng_list.do", method={RequestMethod.GET, RequestMethod.POST})
@ResponseBody
public Map<String, Object> BbsUseMng_listAjax(@ModelAttribute("searchVO") XitBbsUseMngSearchVO 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 = xitBbsUseMngService.findListTotCnt(searchVO);
paginationInfo.setTotalRecordCount(totCnt);
/**
*
*/
/* ***************************
* tui Grid Response Set
*************************** */
resultMap.put("result", true); //[tui Grid] result
resultMap.put("message", "정상적으로 조회 되었습니다."); //[tui Grid] result message
Map<String, Object> data = new HashMap<String, Object>();
data.put("contents", xitBbsUseMngService.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", "조회에 실패하였습니다."); //[tui Grid] result message
}
return resultMap;
}
/**
* <pre> : .</pre>
* @param cmd
* @param model
* @return String
* @author:
* @date: 2020. 4. 16.
*/
@RequestMapping(name = "", value = "BbsUseMng_{cmd}", method={RequestMethod.GET, RequestMethod.POST})
public String BbsUseMng_page(@PathVariable String cmd
, @ModelAttribute("vo") XitBbsUseMngVO vo
, @ModelAttribute("searchVO") XitBbsUseMngSearchVO searchVO
, ModelMap model) {
switch (cmd) {
case "input": //등록 페이지
break;
case "edit": //수정 페이지
case "view": //상세 페이지
XitBbsUseMngVO result = xitBbsUseMngService.findView(vo);
// 시스템 사용 게시판의 경우 URL 표시
if ("SYSTEM_DEFAULT_BOARD".equals(result.getTrgetId())) {
if (result.getBbsTyCode().equals("BBST02")) { // 익명게시판
// result.setProvdUrl("/cop/bbs/anonymous/selectBoardList.do?bbsId=" + result.getBbsId());
result.setProvdUrl(String.format("/framework/biz/mng/bbs/BasicBbsMng_%s_list", result.getBbsId()));
} else {
// result.setProvdUrl("/cop/bbs/selectBoardList.do?bbsId=" + result.getBbsId());
result.setProvdUrl(String.format("/framework/biz/mng/bbs/BasicBbsMng_%s_list", result.getBbsId()));
}
}
model.addAttribute("bdUseVO", result);
break;
default:
throw new RuntimeException("유효하지 않은 요청 입니다.");
}
return FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/bbs/XitBbsUseMng_"+cmd;
}
/**
* <pre> : .</pre>
* @param cmd
* @param model
* @return String
* @author:
* @date: 2020. 4. 16.
*/
@RequestMapping(name = "", value = "BbsUseMng_{cmd}_popup", method={RequestMethod.GET, RequestMethod.POST})
public String BbsUseMng_page_popup(@PathVariable String cmd
, @ModelAttribute("searchVO") XitBbsUseMngSearchVO searchVO
, @ModelAttribute("vo") XitBbsUseMngVO vo, ModelMap model) {
switch (cmd) {
case "": //
break;
default:
throw new RuntimeException("유효하지 않은 요청 입니다.");
}
return FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/bbs/XitBbsUseMng_"+cmd+"_popup";
}
/**
* <pre> : CUD </pre>
* @return String
* @author:
* @throws IOException
* @throws ServletException
* @date: 2020. 4. 16.
*/
@RequestMapping(name = "", value = "BbsUseMng_{cmd}_proc", method=RequestMethod.POST)
public void BbsUseMng_cmd_proc(@PathVariable String cmd
,@ModelAttribute("boardUseInf") XitBbsUseMngVO vo
,@ModelAttribute("searchVO") XitBbsUseMngSearchVO searchVO
,@RequestParam(value="codeIds", required=false, defaultValue="") String codeIds
,BindingResult bindingResult
,SessionStatus status
,Model model
,@RequestParam(value="param_trgetType", required=false, defaultValue="") String param_trgetType
,HttpServletRequest request
,HttpServletResponse response
) throws ServletException, IOException {
/**
*
*/
XitLoginVO loginVO = (XitLoginVO) EgovUserDetailsHelper.getAuthenticatedUser();
String sLocationUrl = "forward:/framework/biz/mng/bbs/BbsUseMng_list";
String message = null;
switch (cmd) {
case "insert": //등록
if (bindingResult.hasErrors()) {
message = "생성에 실패하였습니다.";
sLocationUrl = "forward:/framework/biz/mng/bbs/BbsUseMng_input";
break;
}
//처리
try {
String registSeCode = "";
// CMMNTY 06/CLUB 05/SYSTEM(REGC01)
if ("CMMNTY".equals(param_trgetType)) {
registSeCode = "REGC06";
} else if ("CLUB".equals(param_trgetType)) {
registSeCode = "REGC05";
} else {
registSeCode = "REGC01";
}
vo.setUseYn("Y");
vo.setRegistSeCode(registSeCode);
vo.setRgtr(loginVO.getUniqId());
xitBbsUseMngService.addProc(vo);
status.setComplete();
message = "정상적으로 등록 되었습니다.";
} catch (RuntimeException e) {
message = e.getMessage();
sLocationUrl = "forward:/framework/biz/mng/bbs/BbsUseMng_input";
} catch (Exception e) {
message = "생성에 실패하였습니다.";
sLocationUrl = "forward:/framework/biz/mng/bbs/BbsUseMng_input";
}
break;
// case "inserts": //다건 등록
// break;
case "update": //수정
if (bindingResult.hasErrors()) {
message = "변경에 실패하였습니다.";
sLocationUrl = "forward:/framework/biz/mng/bbs/BbsUseMng_edit";
break;
}
//처리
try {
vo.setMdfr(loginVO.getUniqId());
xitBbsUseMngService.modifyProc(vo);
status.setComplete();
message = "정상적으로 변경 되었습니다.";
} catch (RuntimeException e) {
message = e.getMessage();
sLocationUrl = "forward:/framework/biz/mng/bbs/BbsUseMng_edit";
} catch (Exception e) {
message = "변경에 실패하였습니다.";
sLocationUrl = "forward:/framework/biz/mng/bbs/BbsUseMng_edit";
}
break;
case "delete": //삭제
//처리
try {
vo.setMdfr(loginVO.getUniqId());
xitBbsUseMngService.removeProc(vo);
status.setComplete();
message = "정상적으로 삭제 되었습니다.";
break;
} catch (RuntimeException e) {
message = e.getMessage();
sLocationUrl = "forward:/framework/biz/mng/bbs/BbsUseMng_edit";
} catch (Exception e) {
message = "삭제에 실패하였습니다.";
sLocationUrl = "forward:/framework/biz/mng/bbs/BbsUseMng_edit";
}
break;
// case "deletes": //다건 삭제
// //처리
// try {
// xitBbsUseMngService.removesProc(codeIds, loginVO.getUniqId());
// status.setComplete();
// message = "정상적으로 삭제 되었습니다.";
// } catch (RuntimeException e) {
// message = e.getMessage();
// } catch (Exception e) {
// message = "삭제에 실패하였습니다.";
// }
// 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,116 +0,0 @@
package cokr.xit.fims.framework.core.interceptor;
import com.fasterxml.jackson.databind.JsonMappingException;
import cokr.xit.fims.framework.biz.cache.util.CacheServiceUtils;
import cokr.xit.fims.framework.biz.cmm.XitLoginVO;
import cokr.xit.fims.framework.support.exception.JSONExceptionMessageWriter;
import cokr.xit.fims.framework.support.util.Checks;
import cokr.xit.fims.framework.support.util.constants.Globals;
import cokr.xit.fims.framework.support.util.constants.MessageKey;
import lombok.extern.slf4j.Slf4j;
import org.egovframe.rte.fdl.security.userdetails.util.EgovUserDetailsHelper;
import org.springframework.stereotype.Service;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* <pre>
* @: Interceptor
* @: .
* @: 2020. 3. 24. 4:33:06
* @:
* @
*
* , return
* return
* @author ()
* @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved.
* </pre>
*/
@Slf4j
@Service
public class MenuIntercepter extends HandlerInterceptorAdapter {
private Map<String, Integer> chkUrlAddLength;
/**
* .
*/
@SuppressWarnings("unused")
@Override
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView mv) throws Exception {
if(mv == null) return;
//사용자의 인증 여부 확인
boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated();
String reqPath = request.getRequestURI();//.split("\\.")[0];
/**
*
*/
List<Map<String, String>> allMenuList = null;
//메뉴목록 조회
if(isAuthenticated) {
//사용자정보 취득
XitLoginVO loginVO = (XitLoginVO) EgovUserDetailsHelper.getAuthenticatedUser();
//사용자별 메뉴 목록 조회
allMenuList = null;
}
else {
//익명사용자 메뉴 목록 조회
allMenuList =null;
}
// main page만 메뉴목록 / 공지사항 조회
if(reqPath.contains("/framework/biz/cmm/mainPage")) {
mv.addObject("allMenuList", allMenuList);
}
//요청페이지 정보 Setting
for(int i=0; i < allMenuList.size(); i++) {
Map<String, String> mUrlInfo = allMenuList.get(i);
if (Checks.isNotEmpty(mUrlInfo.get("menuView")) && mUrlInfo.get("menuView").toString().contains(reqPath)) {
String[] arrPath = mUrlInfo.get("menuPath").toString().split("_");
if(arrPath.length > 1){
mUrlInfo.put("secondMenu", arrPath[1]);
}
mv.addObject("urlInfoMap", mUrlInfo);
break;
}
}
}
public Map<String, Integer> getChkUrlAddLength() {
return chkUrlAddLength;
}
public void setChkUrlAddLength(Map<String, Integer> chkUrlAddLength) {
this.chkUrlAddLength = chkUrlAddLength;
}
@Override
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object o, Exception e) throws Exception {
if(e instanceof JsonMappingException) {
JSONExceptionMessageWriter.writer(response, Globals.JSON_ERROR_STATUS_CODE, MessageKey.CMM_FAIL);
}
}
}

@ -1,80 +0,0 @@
package cokr.xit.fims.framework.core.interceptor;
import org.springframework.context.support.ReloadableResourceBundleMessageSource;
import cokr.xit.fims.framework.support.util.AjaxUtils;
import lombok.extern.slf4j.Slf4j;
import org.egovframe.rte.fdl.security.userdetails.util.EgovUserDetailsHelper;
import org.springframework.stereotype.Service;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.PrintWriter;
/**
*
* @: Interceptor
* @:
* .
* @: 2020. 3. 24. 4:33:06
* @:
* @author ()
* @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
@Slf4j
@Service
public class XitAccessIntercepter extends HandlerInterceptorAdapter {
/**
* .
*/
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
throws Exception {
log.info("Access interceptor START !!");
/**
* ContextPath Setting
*/
String contextPath = request.getContextPath();
boolean isExistsContextPath = "/".equals(contextPath)?false:true;
/**
* ()
*/
Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated();
if(isAuthenticated) {
log.info("Authenticated User !!");
}else {
log.info("No Authenticated User !!");
String msg = "custom.fail.access";
response.setCharacterEncoding("UTF-8");
response.setContentType("text/html; charset=UTF-8");
PrintWriter writer=response.getWriter();
if(AjaxUtils.isAjaxRequest(request)){
writer.println(msg);
}else {
if(isExistsContextPath)
writer.println("<script type='text/javascript'>alert(\""+msg+"\"); location.href='"+contextPath+"/login/actionMain.do';</script>");
else
writer.println("<script type='text/javascript'>alert(\""+msg+"\"); location.href='/login/actionMain.do';</script>");
}
return false;
}
log.info("Access interceptor COMPLETE !!");
return true;
}
}

@ -1,67 +0,0 @@
package cokr.xit.fims.framework.core.interceptor;
import cokr.xit.fims.framework.core.utils.XitCmmnUtil;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
*
* @: Interceptor
* @: (CSP), Xframe .
* @: 2020. 11. 12. 6:04:09
* @:
* @author ()
* @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
public class XitSecurityHeaderIntercepter extends HandlerInterceptorAdapter {
/** XFrame 설정-클랙재킹 공격에 대한 보안 설정 */
String strXframeConfig = "SAMEORIGIN"; //DENY: 이 사이트는 iframe 내에 출력되는 것을 허용하지 않음, SAMEORIGIN: 이 사이트는 동일 도메인 페이지 내에서만 출력 가능. ALLOW-FROM origin: 이 사이트는 origin 도메인의 페이지에서 출력하는 것을 허용 함.
/** CSP 설정 */
List<String> listCspConfig;
@Override
public void postHandle(
HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView)
throws Exception {
// response.setHeader("Strict-Transport-Security","max-age=31536000 ; includeSubDomains");
// response.setHeader("X-Content-Type-Options", "nosniff");
// response.setHeader("X-XSS-Protection", "1; mode=block");
//X-Frame 헤더 설정
if(!( this.strXframeConfig==null || "".equals(this.strXframeConfig) ))
response.setHeader("X-Frame-Options", this.strXframeConfig);
//CSP(콘텐츠 보안 정책) 헤더 설정
if (XitCmmnUtil.notEmpty(this.listCspConfig)) {
StringBuffer sb = new StringBuffer();
for(int i=0; i<this.listCspConfig.size(); i++) {
if(i>0)
sb.append("; ");
sb.append(this.listCspConfig.get(i));
}
response.setHeader("Content-Security-Policy", sb.toString());
}
}
public void setListCspConfig(List<String> listCspConfig) {
this.listCspConfig = listCspConfig;
}
public void setStrXframeConfig(String strXframeConfig) {
this.strXframeConfig = strXframeConfig;
}
}

@ -1,127 +0,0 @@
package cokr.xit.fims.framework.core.resolver;
/*
* Copyright 2001-2006 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the ";License&quot;);
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS"; BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import org.apache.commons.fileupload.FileItem;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.util.StringUtils;
import org.springframework.web.multipart.MultipartException;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.commons.CommonsMultipartFile;
import org.springframework.web.multipart.commons.CommonsMultipartResolver;
import javax.servlet.ServletContext;
import java.io.UnsupportedEncodingException;
import java.util.*;
/**
*
* @:
* @: CommonsMultipartResolver.parseFileItems
* <br/>-&lt;input type="file".../&gt; servlet
* <br/>- &lt;input type="file".../&gt; name
* @: 2020. 5. 15. 4:51:29
* @:
* @author ()
* @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
public class XitMultipartResolver extends CommonsMultipartResolver {
private static final Logger LOGGER = LoggerFactory.getLogger(XitMultipartResolver.class);
public XitMultipartResolver() {
}
/**
* multipart resolver .
*
* @param servletContext
*/
public XitMultipartResolver(ServletContext servletContext) {
super(servletContext);
}
/**
* multipart parsing .
*/
@SuppressWarnings("rawtypes")
@Override
protected MultipartParsingResult parseFileItems(List fileItems, String encoding) {
MultiValueMap<String, MultipartFile> multipartFiles = new LinkedMultiValueMap<String, MultipartFile>();
Map<String, String[]> multipartParameters = new HashMap<String, String[]>();
for (Iterator<?> it = fileItems.iterator(); it.hasNext();) {
FileItem fileItem = (FileItem) it.next();
/**
*
* -(field) or .
* -(field) Map, MultipartFile parsing List Collection wrapping .
*/
if (fileItem.isFormField()) {
/* ============================
* field Map
============================ */
String value = null;
if (encoding != null) {
try {
value = fileItem.getString(encoding);
} catch (UnsupportedEncodingException ex) {
LOGGER.warn("Could not decode multipart item '{}' with encoding '{}': using platform default", fileItem.getFieldName(), encoding);
value = fileItem.getString();
}
} else {
value = fileItem.getString();
}
String[] curParam = multipartParameters.get(fileItem.getFieldName());
if (curParam == null) {
multipartParameters.put(fileItem.getFieldName(), new String[] { value });
} else {
String[] newParam = StringUtils.addStringToArray(curParam, value);
multipartParameters.put(fileItem.getFieldName(), newParam);
}
} else {
/* ============================
* List
* - 0 .
============================ */
if (fileItem.getSize() > 0) {
CommonsMultipartFile file = new CommonsMultipartFile(fileItem);
List<MultipartFile> fileList = new ArrayList<MultipartFile>();
fileList.add(file);
if (multipartFiles.put(fileItem.getName(), fileList) != null) {
throw new MultipartException("Multiple files for field name [" + file.getName() + "] found - not supported by MultipartResolver");
}
LOGGER.debug("Found multipart file [" + file.getName() + "] of size " + file.getSize() + " bytes with original filename [" + file.getOriginalFilename()
+ "], stored " + file.getStorageDescription());
}
}
}
return new MultipartParsingResult(multipartFiles, multipartParameters, null);
}
}
Loading…
Cancel
Save