mirror of
http://git.mhez-qa.uplus.co.kr/hubez/hubez-admin.git
synced 2025-12-07 02:16:34 +09:00
발신번호 등록 수정
This commit is contained in:
@@ -11,9 +11,13 @@ import io.swagger.annotations.ApiResponses;
|
||||
import kr.co.uplus.ez.api.sendNumMgt.dto.*;
|
||||
import kr.co.uplus.ez.common.components.ValidComponents;
|
||||
import kr.co.uplus.ez.common.data.ApiResponseCode;
|
||||
import kr.co.uplus.ez.common.utils.FileIoUtils;
|
||||
import kr.co.uplus.ez.common.utils.FileUtil;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
@@ -21,6 +25,9 @@ import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
@RestController
|
||||
@RequestMapping(value = "api/v1/bo/sendNumMgt")
|
||||
@@ -33,6 +40,12 @@ public class SendNumMgtController {
|
||||
|
||||
@Autowired
|
||||
ValidComponents validComponents;
|
||||
|
||||
private static int BUFFERSIZE = 1024;
|
||||
|
||||
@Value("${file-resource.info.sendNumber.path:/efs/admin/sendNumber/}")
|
||||
private String sendNumUploadPath;
|
||||
|
||||
/**
|
||||
* date : 2022. 4. 25.
|
||||
* auth : ckr
|
||||
@@ -197,8 +210,19 @@ public class SendNumMgtController {
|
||||
return sendNumService.updateAppr(updateApprReqDto);
|
||||
}
|
||||
|
||||
/** 제출 서류 다운로드 */
|
||||
public void downloadDoc(HttpServletRequest request, HttpServletResponse response, InsertNumberFile docFile) {
|
||||
sendNumService.downloadDoc(request, response, docFile);
|
||||
/**
|
||||
* 파일 다운로드
|
||||
* @throws IOException
|
||||
*/
|
||||
@SuppressWarnings("rawtypes")
|
||||
@RequestMapping("/filedownload")
|
||||
public void filedownload(@RequestBody LinkedHashMap param, HttpServletRequest request, HttpServletResponse response) throws IOException {
|
||||
logger.debug(param.toString());
|
||||
|
||||
File file = new File(param.get("filePath") + File.separator + param.get("fileNm"));
|
||||
if (file.exists()) {
|
||||
FileIoUtils.fileDownload(file, request, response );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -56,4 +56,6 @@ interface SendNumMgtMapper {
|
||||
int upddateSndrnoReg(UpdateApprReqDto updateApprReqDto);
|
||||
|
||||
int updateSvcUser(UpdateApprReqDto updateApprReqDto);
|
||||
|
||||
InsertNumberFile selectDownload(InsertNumberFile insertNumberFile);
|
||||
}
|
||||
|
||||
@@ -1,12 +1,19 @@
|
||||
package kr.co.uplus.ez.api.sendNumMgt;
|
||||
|
||||
import kr.co.uplus.ez.api.sendNumMgt.dto.*;
|
||||
import kr.co.uplus.ez.common.data.ApiResponseCode;
|
||||
import kr.co.uplus.ez.common.data.Const;
|
||||
import kr.co.uplus.ez.common.data.Paging;
|
||||
import kr.co.uplus.ez.common.utils.DateUtils;
|
||||
import kr.co.uplus.ez.common.utils.FileIoUtils;
|
||||
import kr.co.uplus.ez.common.utils.FileUtil;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.mybatis.spring.SqlSessionTemplate;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -19,13 +26,46 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import kr.co.uplus.ez.api.sendNumMgt.dto.DeleteNumberReqDto;
|
||||
import kr.co.uplus.ez.api.sendNumMgt.dto.DeleteNumberResDto;
|
||||
import kr.co.uplus.ez.api.sendNumMgt.dto.DetailNumber;
|
||||
import kr.co.uplus.ez.api.sendNumMgt.dto.DetailNumberReqDto;
|
||||
import kr.co.uplus.ez.api.sendNumMgt.dto.DetailNumberResDto;
|
||||
import kr.co.uplus.ez.api.sendNumMgt.dto.InsertNumber;
|
||||
import kr.co.uplus.ez.api.sendNumMgt.dto.InsertNumberFile;
|
||||
import kr.co.uplus.ez.api.sendNumMgt.dto.InsertNumberReqDto;
|
||||
import kr.co.uplus.ez.api.sendNumMgt.dto.InsertNumberRes;
|
||||
import kr.co.uplus.ez.api.sendNumMgt.dto.InsertNumberResDto;
|
||||
import kr.co.uplus.ez.api.sendNumMgt.dto.ProfileInfo;
|
||||
import kr.co.uplus.ez.api.sendNumMgt.dto.ProfileListReqDto;
|
||||
import kr.co.uplus.ez.api.sendNumMgt.dto.ProfileListRes;
|
||||
import kr.co.uplus.ez.api.sendNumMgt.dto.ProfileListResDto;
|
||||
import kr.co.uplus.ez.api.sendNumMgt.dto.SendAdminInfo;
|
||||
import kr.co.uplus.ez.api.sendNumMgt.dto.SendAdminListReqDto;
|
||||
import kr.co.uplus.ez.api.sendNumMgt.dto.SendAdminListRes;
|
||||
import kr.co.uplus.ez.api.sendNumMgt.dto.SendAdminListResDto;
|
||||
import kr.co.uplus.ez.api.sendNumMgt.dto.SendNumberApprDetailReqDto;
|
||||
import kr.co.uplus.ez.api.sendNumMgt.dto.SendNumberApprDetailRes;
|
||||
import kr.co.uplus.ez.api.sendNumMgt.dto.SendNumberApprDetailResDto;
|
||||
import kr.co.uplus.ez.api.sendNumMgt.dto.SendNumberApprDoc;
|
||||
import kr.co.uplus.ez.api.sendNumMgt.dto.SendNumberApprInfo;
|
||||
import kr.co.uplus.ez.api.sendNumMgt.dto.SendNumberApprListReqDto;
|
||||
import kr.co.uplus.ez.api.sendNumMgt.dto.SendNumberApprListRes;
|
||||
import kr.co.uplus.ez.api.sendNumMgt.dto.SendNumberApprListResDto;
|
||||
import kr.co.uplus.ez.api.sendNumMgt.dto.SendNumberApprNum;
|
||||
import kr.co.uplus.ez.api.sendNumMgt.dto.SendNumberInfo;
|
||||
import kr.co.uplus.ez.api.sendNumMgt.dto.SendNumberListReqDto;
|
||||
import kr.co.uplus.ez.api.sendNumMgt.dto.SendNumberListRes;
|
||||
import kr.co.uplus.ez.api.sendNumMgt.dto.SendNumberListResDto;
|
||||
import kr.co.uplus.ez.api.sendNumMgt.dto.UpdateApprReqDto;
|
||||
import kr.co.uplus.ez.api.sendNumMgt.dto.UpdateApprResDto;
|
||||
import kr.co.uplus.ez.api.sendNumMgt.dto.UpdateApprSendNumber;
|
||||
import kr.co.uplus.ez.common.data.ApiResponseCode;
|
||||
import kr.co.uplus.ez.common.data.Const;
|
||||
import kr.co.uplus.ez.common.data.Paging;
|
||||
import kr.co.uplus.ez.common.utils.DateUtils;
|
||||
import kr.co.uplus.ez.common.utils.FileIoUtils;
|
||||
import kr.co.uplus.ez.common.utils.FileUtil;
|
||||
|
||||
@Service
|
||||
public class SendNumMgtService {
|
||||
@@ -40,6 +80,8 @@ public class SendNumMgtService {
|
||||
|
||||
@Value("${file-resource.info.sendNumber.path:/efs/admin/sendNumber/}")
|
||||
private String sendNumUploadPath;
|
||||
|
||||
private static int BUFFERSIZE = 1024;
|
||||
/**
|
||||
* date : 2022. 4. 25.
|
||||
* auth : ckr
|
||||
@@ -197,7 +239,7 @@ public class SendNumMgtService {
|
||||
String userSeq = sendNumMgtMapper.selectUserSeqByAdminId(adminId);
|
||||
try {
|
||||
Date now = new Date();
|
||||
String nowDate = DateUtils.dateToStr(now, "yyyyMMddHHmmss");
|
||||
String nowDate = DateUtils.dateToStr(now, "yyyyMMddHHmmss");
|
||||
insertNumberReqDto.setUserSeq(userSeq);
|
||||
insertNumberReqDto.setReqCnt(insertNumberReqDto.getList().size());
|
||||
insertNumberReqDto.setRegId(regId);
|
||||
@@ -206,7 +248,6 @@ public class SendNumMgtService {
|
||||
insertNumberReqDto.setRejtCnt(0); // 반려 건수
|
||||
insertNumberReqDto.setReqSttusCd(Const.SNDRNO_REQ_STTUS_CD_COMPLETED); // 요청 상태 코드(01:승인대기, 02:처리완료)
|
||||
insertNumberReqDto.setCmpltDt(nowDate); // 완료일시
|
||||
|
||||
|
||||
// 2. 발신번호등록 테이블 저장. (EZ_SNDRNO_REG)
|
||||
sendNumMgtMapper.insertNumber(insertNumberReqDto);
|
||||
@@ -234,14 +275,14 @@ public class SendNumMgtService {
|
||||
sendNumMgtMapper.insertNumberList(dbInsertNumber);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 사업자 인증 여부 Y
|
||||
if(allSendNumbers.size() > 0) {
|
||||
UpdateApprReqDto updateApprReqDto = new UpdateApprReqDto();
|
||||
updateApprReqDto.setAdminId(adminId);
|
||||
sendNumMgtMapper.updateSvcUser(updateApprReqDto);
|
||||
}
|
||||
|
||||
|
||||
// 사업자 인증이 안된 경우 파일업로드...
|
||||
if(!StringUtils.equals(Const.COMM_YES, insertNumberReqDto.getBizrAuthYn())){
|
||||
|
||||
@@ -250,39 +291,87 @@ public class SendNumMgtService {
|
||||
|
||||
List<MultipartFile> multipartFiles = new ArrayList<>();
|
||||
List<String> docTpCd = new ArrayList<>();
|
||||
|
||||
// 통신서비스이용 증명원 '01'
|
||||
MultipartFile communicationFile = multipartRequest.getFile("communicationFile");
|
||||
multipartFiles.add(communicationFile);
|
||||
docTpCd.add(Const.SNDRNO_DOC_TP_CD_01);
|
||||
|
||||
// 재직증명서 '02'
|
||||
MultipartFile tenureFile = multipartRequest.getFile("tenureFile");
|
||||
multipartFiles.add(tenureFile);
|
||||
docTpCd.add(Const.SNDRNO_DOC_TP_CD_02);
|
||||
|
||||
// 사업자등록증 '06'
|
||||
MultipartFile businessFile = multipartRequest.getFile("businessFile");
|
||||
multipartFiles.add(businessFile);
|
||||
docTpCd.add(Const.SNDRNO_DOC_TP_CD_06);
|
||||
|
||||
if(StringUtils.equals(Const.SNDRNO_TP_CD_OTHER, insertNumberReqDto.getNmineeDivCd())){
|
||||
// 위임-수임관계 확인 서류 '03'
|
||||
MultipartFile trustFile = multipartRequest.getFile("trustFile");
|
||||
multipartFiles.add(trustFile);
|
||||
if(StringUtils.equals(Const.SNDRNO_TP_CD_SELF, insertNumberReqDto.getNmineeDivCd())) {
|
||||
// 통신서비스이용 증명원 '01'
|
||||
MultipartFile communicationFile = multipartRequest.getFile("communicationFile");
|
||||
multipartFiles.add(communicationFile);
|
||||
docTpCd.add(Const.SNDRNO_DOC_TP_CD_01);
|
||||
|
||||
// 재직증명서 '02'
|
||||
MultipartFile tenureFile = multipartRequest.getFile("tenureFile");
|
||||
multipartFiles.add(tenureFile);
|
||||
docTpCd.add(Const.SNDRNO_DOC_TP_CD_02);
|
||||
|
||||
// 사업자등록증 '06'
|
||||
MultipartFile businessFile = multipartRequest.getFile("businessFile");
|
||||
multipartFiles.add(businessFile);
|
||||
docTpCd.add(Const.SNDRNO_DOC_TP_CD_06);
|
||||
|
||||
// 신분증(본인확인) '13'
|
||||
MultipartFile identificationCardFile = multipartRequest.getFile("identificationCardFile");
|
||||
multipartFiles.add(identificationCardFile);
|
||||
docTpCd.add(Const.SNDRNO_DOC_TP_CD_13);
|
||||
|
||||
// 재직증명서(본인확인) '14'
|
||||
MultipartFile identificationEvidenceFile = multipartRequest.getFile("identificationEvidenceFile");
|
||||
multipartFiles.add(identificationEvidenceFile);
|
||||
docTpCd.add(Const.SNDRNO_DOC_TP_CD_14);
|
||||
|
||||
} else if(StringUtils.equals(Const.SNDRNO_TP_CD_OTHER, insertNumberReqDto.getNmineeDivCd())){
|
||||
// 위임-수임사간 관계 확인 문서 '03'
|
||||
MultipartFile delegationFile = multipartRequest.getFile("delegationFile");
|
||||
multipartFiles.add(delegationFile);
|
||||
docTpCd.add(Const.SNDRNO_DOC_TP_CD_03);
|
||||
|
||||
// 위임장 '04'
|
||||
MultipartFile warrantFile = multipartRequest.getFile("warrantFile");
|
||||
multipartFiles.add(warrantFile);
|
||||
MultipartFile attorneyFile = multipartRequest.getFile("attorneyFile");
|
||||
multipartFiles.add(attorneyFile);
|
||||
docTpCd.add(Const.SNDRNO_DOC_TP_CD_04);
|
||||
// 대리인신분증 사본인증 '05'
|
||||
MultipartFile deputyFile = multipartRequest.getFile("deputyFile");
|
||||
multipartFiles.add(deputyFile);
|
||||
docTpCd.add(Const.SNDRNO_DOC_TP_CD_05);
|
||||
// 타사업자등록증 '07'
|
||||
|
||||
// 법인인감증명서 '12'
|
||||
MultipartFile corporateCertificateFile = multipartRequest.getFile("corporateCertificateFile");
|
||||
multipartFiles.add(corporateCertificateFile);
|
||||
docTpCd.add(Const.SNDRNO_DOC_TP_CD_12);
|
||||
|
||||
// 위임사 사업자등록증 '10'
|
||||
MultipartFile delegatedBusinessFile = multipartRequest.getFile("delegatedBusinessFile");
|
||||
multipartFiles.add(delegatedBusinessFile);
|
||||
docTpCd.add(Const.SNDRNO_DOC_TP_CD_10);
|
||||
|
||||
// 수임사 사업자등록증 '11'
|
||||
MultipartFile authorizedBusinessFile = multipartRequest.getFile("authorizedBusinessFile");
|
||||
multipartFiles.add(authorizedBusinessFile);
|
||||
docTpCd.add(Const.SNDRNO_DOC_TP_CD_11);
|
||||
|
||||
// 통신서비스이용 증명원 '01'
|
||||
MultipartFile communicationFile = multipartRequest.getFile("communicationFile");
|
||||
multipartFiles.add(communicationFile);
|
||||
docTpCd.add(Const.SNDRNO_DOC_TP_CD_01);
|
||||
|
||||
// 위임사 재직증명서(임직원 신청시) '09'
|
||||
MultipartFile delegateCertificateFile = multipartRequest.getFile("delegateCertificateFile");
|
||||
multipartFiles.add(delegateCertificateFile);
|
||||
docTpCd.add(Const.SNDRNO_DOC_TP_CD_09);
|
||||
|
||||
// 위임사 신분증(임직원 신청시) '08'
|
||||
MultipartFile delegatedIdentificationFile = multipartRequest.getFile("delegatedIdentificationFile");
|
||||
multipartFiles.add(delegatedIdentificationFile);
|
||||
docTpCd.add(Const.SNDRNO_DOC_TP_CD_08);
|
||||
|
||||
// 사업자등록증(타사) '07'
|
||||
MultipartFile otherBusinessFile = multipartRequest.getFile("otherBusinessFile");
|
||||
multipartFiles.add(otherBusinessFile);
|
||||
docTpCd.add(Const.SNDRNO_DOC_TP_CD_07);
|
||||
|
||||
// 신분증(본인확인) '13'
|
||||
MultipartFile identificationCardFile = multipartRequest.getFile("identificationCardFile");
|
||||
multipartFiles.add(identificationCardFile);
|
||||
docTpCd.add(Const.SNDRNO_DOC_TP_CD_13);
|
||||
|
||||
// 재직증명서(본인확인) '14'
|
||||
MultipartFile identificationEvidenceFile = multipartRequest.getFile("identificationEvidenceFile");
|
||||
multipartFiles.add(identificationEvidenceFile);
|
||||
docTpCd.add(Const.SNDRNO_DOC_TP_CD_14);
|
||||
}
|
||||
|
||||
// 파일 업로드 및 테이블 저장 (등록 서류 관련).
|
||||
@@ -293,14 +382,16 @@ public class SendNumMgtService {
|
||||
String fileNm = regReqNo + "_" + docTpCd.get(j).substring(1,2) + "_" + docTpCd.get(j) + "." + ext;
|
||||
String titleNm = multipartFiles.get(j).getOriginalFilename();
|
||||
long fileSize = multipartFiles.get(j).getSize();
|
||||
|
||||
|
||||
|
||||
// File Upload.
|
||||
FileUtil.upload(multipartFiles.get(j), fileNm, path);
|
||||
|
||||
// 발신번호 등록 서류 테이블 저장 (EZ_SNDRNO_DOC).
|
||||
InsertNumberFile insertFile = new InsertNumberFile();
|
||||
insertFile.setRegReqNo(regReqNo);
|
||||
insertFile.setDocNo(docTpCd.get(j).substring(1,2));
|
||||
insertFile.setDocNo("" + Integer.parseInt(docTpCd.get(j)));
|
||||
//insertFile.setDocNo(docTpCd.get(j).substring(1,2));
|
||||
insertFile.setDocTpCd(docTpCd.get(j));
|
||||
insertFile.setDocTitle(titleNm);
|
||||
insertFile.setFileNm(fileNm);
|
||||
@@ -323,14 +414,6 @@ public class SendNumMgtService {
|
||||
return new InsertNumberResDto(ApiResponseCode.SUCCESS, insertNumberRes);
|
||||
}
|
||||
|
||||
// 다운로트 제출서류
|
||||
public void downloadDoc(HttpServletRequest request, HttpServletResponse response, InsertNumberFile docFile) {
|
||||
|
||||
|
||||
String fileName = "";
|
||||
//FileUtil.download(request, response, sendNumUploadPath, fileName);
|
||||
}
|
||||
|
||||
/**
|
||||
* date : 2022. 4. 25.
|
||||
* auth : ckr
|
||||
@@ -449,9 +532,11 @@ public class SendNumMgtService {
|
||||
// 발신번호 문서 목록 조회
|
||||
List<SendNumberApprDoc> sendNumberApprDocs = sendNumMgtMapper.selectSndnoDocList(sendNumberApprDetailReqDto);
|
||||
|
||||
|
||||
sendNumberApprDetailRes.setNumList(sendNumberApprNums);
|
||||
sendNumberApprDetailRes.setDocList(sendNumberApprDocs);
|
||||
|
||||
|
||||
return new SendNumberApprDetailResDto(ApiResponseCode.SUCCESS, sendNumberApprDetailRes);
|
||||
}
|
||||
|
||||
@@ -489,14 +574,14 @@ public class SendNumMgtService {
|
||||
updateApprReqDto.setApvCnt(apvCnt);
|
||||
updateApprReqDto.setRejtCnt(rejtCnt);
|
||||
|
||||
// 발신 번호 등록 정보 가져오기
|
||||
SendNumberApprDetailReqDto sendNumberApprDetailReqDto = new SendNumberApprDetailReqDto();
|
||||
// 발신 번호 등록 정보 가져오기
|
||||
SendNumberApprDetailReqDto sendNumberApprDetailReqDto = new SendNumberApprDetailReqDto();
|
||||
sendNumberApprDetailReqDto.setRegReqNo(updateApprReqDto.getRegReqNo()); // 발신 번호 세팅
|
||||
SendNumberApprDetailRes sendNumberApprDetailRes = sendNumMgtMapper.selectSvcSndrnoReqDetail(sendNumberApprDetailReqDto);
|
||||
|
||||
|
||||
if(sendNumberApprDetailRes != null) {
|
||||
String cmpltDt = sendNumberApprDetailRes.getCmpltDt();
|
||||
// if(cmpltDt == null) { // 완료 일시가 없으면
|
||||
// if(cmpltDt == null) { // 완료 일시가 없으면
|
||||
// if(totalCnt == (apvCnt + rejtCnt)){ // (승인 | 반려) 처리가 다 되었는지 확인
|
||||
// updateApprReqDto.setReqSttusCd(Const.SNDRNO_REQ_STTUS_CD_COMPLETED);
|
||||
// updateApprReqDto.setCmpltYn(Const.COMM_YES);
|
||||
@@ -523,6 +608,110 @@ public class SendNumMgtService {
|
||||
return new UpdateApprResDto(ApiResponseCode.SUCCESS);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* InputStream을 종료한다.
|
||||
*/
|
||||
public static void close(InputStream stream) {
|
||||
if (stream != null) {
|
||||
try {
|
||||
stream.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* OutputStream을 종료한다.
|
||||
*/
|
||||
public static void close(OutputStream stream) {
|
||||
if (stream != null) {
|
||||
try {
|
||||
stream.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* FileOutputStream을 종료한다.
|
||||
*/
|
||||
public static void close(FileOutputStream stream) {
|
||||
if (stream != null) {
|
||||
try {
|
||||
stream.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
// 다운로드 제출서류
|
||||
public void downloadDoc(HttpServletRequest request, HttpServletResponse response, InsertNumberFile docFile) {
|
||||
|
||||
SendNumMgtMapper sendNumMgtMapper = sqlSessionSlave.getMapper(SendNumMgtMapper.class);
|
||||
|
||||
InsertNumberFile selectFile = sendNumMgtMapper.selectDownload(docFile);
|
||||
|
||||
String fileName = selectFile.getDocTitle();
|
||||
String oriFileName = selectFile.getFileNm();
|
||||
String filePath = selectFile.getFilePath();
|
||||
|
||||
|
||||
StringBuilder sb = new StringBuilder("D:" + filePath + "/");
|
||||
sb.append(oriFileName);
|
||||
String saveFileName = sb.toString();
|
||||
|
||||
String contentType = request.getContentType();
|
||||
File file = new File(saveFileName);
|
||||
long fileLength = file.length();
|
||||
|
||||
String extension = FilenameUtils.getExtension(saveFileName).toLowerCase();
|
||||
|
||||
// 형태에 따른 컨텐트 타입 분류
|
||||
if ("zip".equals(extension)) response.setContentType("application/zip");
|
||||
else if ("xls".equals(extension) || "xlsx".equals(extension)) response.setContentType("application/vnd.ms-excel;charset=UTF-8");
|
||||
else if ("ppt".equals(extension) || "pptx".equals(extension)) response.setContentType("application/x-mspowerpoint");
|
||||
else if ("doc".equals(extension) || "docx".equals(extension)) response.setContentType("application/msword");
|
||||
else if ("pdf".equals(extension)) response.setContentType("application/x-msdownload");
|
||||
else if ("jpg".equals(extension)) response.setContentType("image/jpg");
|
||||
else if ("gif".equals(extension)) response.setContentType("image/gif");
|
||||
else if ("png".equals(extension)) response.setContentType("image/png");
|
||||
|
||||
|
||||
response.setHeader("Content-Disposition", "attachment; filename=" + fileName + ";");
|
||||
response.setHeader("Content-Transfer-Encoding", "binary");
|
||||
response.setHeader("Content-Type", contentType);
|
||||
response.setHeader("Content-Length", "" + fileLength);
|
||||
response.setHeader("Pragma", "no-cache;");
|
||||
response.setHeader("Expires", "-1;");
|
||||
|
||||
try {
|
||||
FileInputStream fis = new FileInputStream(saveFileName);
|
||||
OutputStream out = response.getOutputStream();
|
||||
|
||||
|
||||
int readCount = 0;
|
||||
byte[] buffer = new byte[BUFFERSIZE];
|
||||
|
||||
while ((readCount = fis.read(buffer)) != -1 ) {
|
||||
out.write(buffer, 0 , readCount);
|
||||
}
|
||||
out.flush();
|
||||
}catch(Exception e) {
|
||||
throw new RuntimeException("File load Error");
|
||||
}
|
||||
|
||||
//String fileStr ="C:/efs/admin/sendNumber/2022/07/2022071018012_2_02.PNG.png";
|
||||
//String fileStr = filePath + oriFileName;
|
||||
// String fileStr = filePath + oriFileName;
|
||||
// File file = new File(fileStr);
|
||||
// FileUtil.download(request, response, fileName, file);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -15,4 +15,7 @@ public class InsertNumberFile implements Serializable{
|
||||
private String filePath;
|
||||
private long fileSize;
|
||||
private String regId;
|
||||
private String regDt;
|
||||
private String chgId;
|
||||
private String chgDt;
|
||||
}
|
||||
|
||||
@@ -24,29 +24,48 @@ public class InsertNumberReqDto implements Serializable{
|
||||
@ApiModelProperty(example = "사업자인증여부", name = "사업자인증여부", dataType = "String")
|
||||
private String bizrAuthYn;
|
||||
|
||||
|
||||
private List<InsertNumber> list;
|
||||
|
||||
@ApiModelProperty(example = "file", name = "위임-수임관계 확인 서류", dataType = "String")
|
||||
private MultipartFile trustFile;
|
||||
|
||||
@ApiModelProperty(example = "file", name = "위임장", dataType = "String")
|
||||
private MultipartFile warrantFile;
|
||||
|
||||
@ApiModelProperty(example = "file", name = "대리인 신분증 사본 인증", dataType = "String")
|
||||
private MultipartFile deputyFile;
|
||||
|
||||
@ApiModelProperty(example = "file", name = "통신서비스 이용증명원", dataType = "String")
|
||||
private MultipartFile communicationFile;
|
||||
|
||||
@ApiModelProperty(example = "file", name = "재직증명서", dataType = "String")
|
||||
private MultipartFile tenureFile;
|
||||
|
||||
@ApiModelProperty(example = "file", name = "통신서비스 이용증명원", dataType = "String")
|
||||
private MultipartFile communicationFile;
|
||||
@ApiModelProperty(example = "file", name = "위임-수임사간 관계 확인 문서", dataType = "String")
|
||||
private MultipartFile delegationFile;
|
||||
|
||||
@ApiModelProperty(example = "file", name = "위임장", dataType = "String")
|
||||
private MultipartFile attorneyFile;
|
||||
|
||||
@ApiModelProperty(example = "file", name = "사업자등록증", dataType = "String")
|
||||
private MultipartFile businessFile;
|
||||
|
||||
@ApiModelProperty(example = "file", name = "타사업자등록증", dataType = "String")
|
||||
@ApiModelProperty(example = "file", name = "사업자등록증(타사)", dataType = "String")
|
||||
private MultipartFile otherBusinessFile;
|
||||
|
||||
@ApiModelProperty(example = "file", name = "위임사 신분증(임직원 신청시)", dataType = "String")
|
||||
private MultipartFile delegatedIdentificationFile;
|
||||
|
||||
@ApiModelProperty(example = "file", name = "위임사 재직증명서(임직원 신청시)", dataType = "String")
|
||||
private MultipartFile delegateCertificateFile;
|
||||
|
||||
@ApiModelProperty(example = "file", name = "위임사 사업자등록증", dataType = "String")
|
||||
private MultipartFile delegatedBusinessFile;
|
||||
|
||||
@ApiModelProperty(example = "file", name = "수임사 사업자등록증", dataType = "String")
|
||||
private MultipartFile authorizedBusinessFile;
|
||||
|
||||
@ApiModelProperty(example = "file", name = "법인인감증명서", dataType = "String")
|
||||
private MultipartFile corporateCertificateFile;
|
||||
|
||||
@ApiModelProperty(example = "file", name = "신분증(본인확인)", dataType = "String")
|
||||
private MultipartFile identificationCardFile;
|
||||
|
||||
@ApiModelProperty(example = "file", name = "재직증명서(본인확인)", dataType = "String")
|
||||
private MultipartFile identificationEvidenceFile;
|
||||
|
||||
|
||||
// @ApiModelProperty(example = "발신번호 인증 파일", name = "발신번호 인증 파일", dataType = "String")
|
||||
// private List<MultipartFile> authSendNum;
|
||||
|
||||
|
||||
@@ -32,5 +32,15 @@ public class SendNumberApprDetailRes implements Serializable{
|
||||
private String slfAuthHp;
|
||||
@ApiModelProperty(example = "메모", name = "메모", dataType = "String")
|
||||
private String memo;
|
||||
@ApiModelProperty(example = "파일이름", name = "파일이름", dataType = "String", hidden = true)
|
||||
private String fileNm;
|
||||
@ApiModelProperty(example = "서류 넘버", name = "서류 넘버", dataType = "String", hidden = true)
|
||||
private String docNo;
|
||||
@ApiModelProperty(example = "서류 제목", name = "서류 제목", dataType = "String", hidden = true)
|
||||
private String docTitle;
|
||||
@ApiModelProperty(example = "서류 유형 코드", name = "서류 유형 코드", dataType = "String", hidden = true)
|
||||
private String docTpCd;
|
||||
@ApiModelProperty(example = "파일 경로", name = "파일 경로", dataType = "String", hidden = true)
|
||||
private String filePath;
|
||||
|
||||
}
|
||||
|
||||
@@ -19,6 +19,8 @@ public class SendNumberApprDoc implements Serializable{
|
||||
private String fileNm;
|
||||
@ApiModelProperty(example = "파일 구분", name = "파일 구분", dataType = "String")
|
||||
private String docTpCd;
|
||||
|
||||
|
||||
@ApiModelProperty(example = "등록 요청 번호", name = "등록 요청 번호", dataType = "String", hidden = true)
|
||||
private String regReqNo;
|
||||
@ApiModelProperty(example = "서류 번호", name = "서류 번호", dataType = "String", hidden = true)
|
||||
private String docNo;
|
||||
}
|
||||
|
||||
@@ -90,13 +90,34 @@ public class Const {
|
||||
/** 가입 상태 코드(99:해지) */
|
||||
public static final String SUBS_STTUS_CD_BREAK = "99";
|
||||
|
||||
/** 통신서비스 이용증명원 */
|
||||
public static final String SNDRNO_DOC_TP_CD_01 = "01";
|
||||
/** 재직증명서 */
|
||||
public static final String SNDRNO_DOC_TP_CD_02 = "02";
|
||||
/** 위임-수임사간 관계 확인 문서 */
|
||||
public static final String SNDRNO_DOC_TP_CD_03 = "03";
|
||||
/** 위임장 */
|
||||
public static final String SNDRNO_DOC_TP_CD_04 = "04";
|
||||
/** 삭제처리 */
|
||||
public static final String SNDRNO_DOC_TP_CD_05 = "05";
|
||||
/** 사업자등록증 */
|
||||
public static final String SNDRNO_DOC_TP_CD_06 = "06";
|
||||
/** 사업자등록증(타사) */
|
||||
public static final String SNDRNO_DOC_TP_CD_07 = "07";
|
||||
/** 위임사 신분증(임직원 신청시) */
|
||||
public static final String SNDRNO_DOC_TP_CD_08 = "08";
|
||||
/** 위임사 재직증명서(임직원 신청시) */
|
||||
public static final String SNDRNO_DOC_TP_CD_09 = "09";
|
||||
/** 위임사 사업자등록증 */
|
||||
public static final String SNDRNO_DOC_TP_CD_10 = "10";
|
||||
/** 수임사 사업자등록증 */
|
||||
public static final String SNDRNO_DOC_TP_CD_11 = "11";
|
||||
/** 법인인감증명서 */
|
||||
public static final String SNDRNO_DOC_TP_CD_12 = "12";
|
||||
/** 신분증 (본인확인) */
|
||||
public static final String SNDRNO_DOC_TP_CD_13 = "13";
|
||||
/** 재직증명서(본인확인) */
|
||||
public static final String SNDRNO_DOC_TP_CD_14 = "14";
|
||||
|
||||
public static final String SNDRNO_TP_CD_SELF = "01";
|
||||
public static final String SNDRNO_TP_CD_OTHER = "02";
|
||||
|
||||
@@ -26,7 +26,7 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
public class FileUtil {
|
||||
|
||||
private static int BUFFERSIZE = 1024;
|
||||
|
||||
|
||||
/**
|
||||
* 폴더 생성
|
||||
*/
|
||||
@@ -52,17 +52,18 @@ public class FileUtil {
|
||||
*/
|
||||
public static boolean upload(MultipartFile file, String filename, String path) {
|
||||
boolean saved = true;
|
||||
|
||||
|
||||
String extension = FilenameUtils.getExtension(file.getOriginalFilename()).toLowerCase();
|
||||
String fos = path + File.separatorChar + filename + "." + extension;
|
||||
|
||||
// String fos = path + File.separatorChar + filename + "." + extension;
|
||||
String fos = path + File.separatorChar + filename;
|
||||
|
||||
InputStream inputStream = null;
|
||||
OutputStream outputStream = null;
|
||||
|
||||
|
||||
try {
|
||||
if (file != null && file.getSize() > 0) {
|
||||
if (!existsFile(path) ) FileUtil.makeDir(path);
|
||||
|
||||
|
||||
inputStream = file.getInputStream();
|
||||
outputStream = new FileOutputStream(fos);
|
||||
int readBytes = 0;
|
||||
@@ -90,7 +91,7 @@ public class FileUtil {
|
||||
public static Map<String, String> upload_newname(MultipartFile file, String path) {
|
||||
String extension = FilenameUtils.getExtension(file.getOriginalFilename()).toLowerCase();
|
||||
String newName = new SimpleDateFormat("yyyyMMddHHmmSSS").format(new Date()) + "." + extension;
|
||||
|
||||
|
||||
Date d = new Date(); // your date
|
||||
Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("Asia/Seoul"));
|
||||
cal.setTime(d);
|
||||
@@ -151,14 +152,14 @@ public class FileUtil {
|
||||
* 다운로드
|
||||
*/
|
||||
private static void download(HttpServletRequest request, HttpServletResponse response, String filename, File file, boolean isDeleteOnExit) {
|
||||
|
||||
|
||||
if (file.exists()) {
|
||||
FileInputStream fileInStream = null;
|
||||
OutputStream outStream = null;
|
||||
|
||||
|
||||
try {
|
||||
String extension = FilenameUtils.getExtension(filename).toLowerCase();
|
||||
|
||||
|
||||
// 형태에 따른 컨텐트 타입 분류
|
||||
if ("zip".equals(extension)) response.setContentType("application/zip");
|
||||
else if ("xls".equals(extension) || "xlsx".equals(extension)) response.setContentType("application/vnd.ms-excel;charset=UTF-8");
|
||||
@@ -168,23 +169,23 @@ public class FileUtil {
|
||||
else if ("jpg".equals(extension)) response.setContentType("image/jpg");
|
||||
else if ("gif".equals(extension)) response.setContentType("image/gif");
|
||||
else if ("png".equals(extension)) response.setContentType("image/png");
|
||||
|
||||
|
||||
response.setHeader("Buffer", "true");
|
||||
response.setHeader("Pragma", "no-cache;");
|
||||
response.setHeader("Expires", "-1;");
|
||||
response.setHeader("Content-Transfer-Encoding", "binary;");
|
||||
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(filename, "UTF-8").replaceAll("\\+", "%20") + ";");
|
||||
|
||||
|
||||
fileInStream = new FileInputStream(file);
|
||||
outStream = response.getOutputStream();
|
||||
|
||||
|
||||
int readBytes = 0;
|
||||
byte[] buffer = new byte[BUFFERSIZE * 100];
|
||||
|
||||
|
||||
while ((readBytes = fileInStream.read(buffer)) != -1) {
|
||||
outStream.write(buffer, 0, readBytes);
|
||||
}
|
||||
|
||||
|
||||
outStream.flush();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
@@ -206,7 +207,7 @@ public class FileUtil {
|
||||
try {
|
||||
ByteArrayOutputStream outByteStream = new ByteArrayOutputStream();
|
||||
workbook.write(outByteStream);
|
||||
|
||||
|
||||
if (workbook instanceof SXSSFWorkbook) {
|
||||
((SXSSFWorkbook) workbook).dispose();
|
||||
}
|
||||
|
||||
@@ -299,6 +299,7 @@
|
||||
,DOC_TITLE
|
||||
,FILE_NM
|
||||
,FILE_PATH
|
||||
,FILE_SIZE
|
||||
,REG_ID
|
||||
,REG_DT
|
||||
,CHG_ID
|
||||
@@ -311,6 +312,7 @@
|
||||
,#{docTitle}
|
||||
,#{fileNm}
|
||||
,#{filePath}
|
||||
,#{fileSize}
|
||||
,#{regId}
|
||||
,NOW()
|
||||
,#{regId}
|
||||
@@ -593,7 +595,9 @@
|
||||
esd.DOC_TITLE ,
|
||||
esd.FILE_PATH ,
|
||||
esd.FILE_NM ,
|
||||
esd.DOC_TP_CD
|
||||
esd.DOC_TP_CD,
|
||||
esd.REG_REQ_NO,
|
||||
esd.DOC_NO
|
||||
FROM
|
||||
hubez_common.EZ_SNDRNO_DOC esd
|
||||
WHERE
|
||||
@@ -643,5 +647,24 @@
|
||||
WHERE
|
||||
USER_ID = #{adminId}
|
||||
</update>
|
||||
|
||||
<select id="selectDownload" parameterType="kr.co.uplus.ez.api.sendNumMgt.dto.InsertNumberFile" resultType="kr.co.uplus.ez.api.sendNumMgt.dto.InsertNumberFile">
|
||||
/* sendNumMgt-mapper.xml(selectDownload) */
|
||||
select
|
||||
REG_REQ_NO,
|
||||
DOC_NO ,
|
||||
DOC_TP_CD ,
|
||||
DOC_TITLE ,
|
||||
FILE_NM ,
|
||||
FILE_PATH ,
|
||||
FILE_SIZE ,
|
||||
REG_ID ,
|
||||
REG_DT ,
|
||||
CHG_ID ,
|
||||
CHG_DT
|
||||
from hubez_common.EZ_SNDRNO_DOC
|
||||
WHERE REG_REQ_NO = #{regReqNo}
|
||||
and DOC_NO = #{docNo}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -6,6 +6,7 @@ xssconfig :
|
||||
- "/multiSendTemplateApi/insertMultiSendTemplate"
|
||||
- "/projectApi/manage/saveProject"
|
||||
- "/api/v1/bo/sendNumMgt/insertNumber"
|
||||
- "/api/v1/bo/sendNumMgt/filedownload"
|
||||
#- "/uc/test/testUrl" #테스트 URL
|
||||
#xss 제외 방식(allow, except)
|
||||
#allow - escape-characters 를 모두 적용 후 allow-elements 만 <, > 치환
|
||||
|
||||
Reference in New Issue
Block a user