품번, 품명 선택박스 select2로 변경완료

This commit is contained in:
leeheejin
2025-12-23 16:33:53 +09:00
parent ac8551c821
commit 1fa303cc0f
15 changed files with 194 additions and 118 deletions

View File

@@ -48,6 +48,9 @@
$('.select2').select2();
fnc_datepick();
// 품번/품명 Select2 AJAX 초기화
initPartSelect2Ajax("#part_no", "#part_name", "#search_part_objid");
//엔터키로 조회
$("input").keyup(function(e){
if(e.keyCode == 13){
@@ -369,10 +372,19 @@ function fn_move(){
</td>
<td><label for="">품번</label></td>
<td><input type="text" name="part_no" id="part_no" autocomplete="off" value="${param.part_no}" style="width:150px;"/></td>
<td>
<select name="part_no" id="part_no" class="select2-part" style="width:150px;">
<option value="">품번 선택</option>
</select>
<input type="hidden" name="search_part_objid" id="search_part_objid" value="">
</td>
<td><label for="">품명</label></td>
<td><input type="text" name="part_name" id="part_name" autocomplete="off" value="${param.part_name}" style="width:170px;"/></td>
<td>
<select name="part_name" id="part_name" class="select2-part" style="width:170px;">
<option value="">품명 선택</option>
</select>
</td>
<td><label for="">PART 구분</label></td>
<td><select name="part_type" id="part_type" class="select2" autocomplete="off" style="width:110px;"><option value="">선택</option>${code_map.part_type}</select></td>

View File

@@ -24,6 +24,9 @@
$('.select2').select2();
fnc_datepick();
// 품번/품명 Select2 AJAX 초기화
initPartSelect2Ajax("#part_no", "#part_name", "#search_part_objid");
//엔터키로 조회
$("input").keyup(function(e){
if(e.keyCode == 13){
@@ -379,10 +382,19 @@
</td> --%>
<td><label for="">품번</label></td>
<td><input type="text" name="part_no" id="part_no" autocomplete="off" value="${param.part_no}" style="width:150px;"/></td>
<td>
<select name="part_no" id="part_no" class="select2-part" style="width:150px;">
<option value="">품번 선택</option>
</select>
<input type="hidden" name="search_part_objid" id="search_part_objid" value="">
</td>
<td><label for="">품명</label></td>
<td><input type="text" name="part_name" id="part_name" autocomplete="off" value="${param.part_name}" style="width:150px;"/></td>
<td>
<select name="part_name" id="part_name" class="select2-part" style="width:150px;">
<option value="">품명 선택</option>
</select>
</td>
<td class=""><label>불출의뢰일</label></td>
<td>

View File

@@ -20,6 +20,9 @@ $(document).ready(function(){
$('.select2').select2();
fnc_datepick();
// 품번/품명 Select2 AJAX 초기화
initPartSelect2Ajax("#part_no", "#part_name", "#search_part_objid");
//fnc_getCodeListAppend("CUST_CD","CUSTOMER_CD","${param.CUSTOMER_CD}");
//$("#Year").val("${sysYear}");
@@ -149,10 +152,19 @@ function fn_partMngHisDetail(objId){
<td><select name="unit_code" id="unit_code" style="width:250px" class="select2" autocomplete="off"></select></td>
<td><label for="">품번</label></td>
<td><input type="text" name="part_no" id="part_no" autocomplete="off" value="${param.part_no }" /></td>
<td>
<select name="part_no" id="part_no" class="select2-part" style="width:150px;">
<option value="">품번 선택</option>
</select>
<input type="hidden" name="search_part_objid" id="search_part_objid" value="">
</td>
<td><label for="">품명</label></td>
<td><input type="text" name="part_name" id="part_name" autocomplete="off" value="${param.part_name}" /></td>
<td>
<select name="part_name" id="part_name" class="select2-part" style="width:150px;">
<option value="">품명 선택</option>
</select>
</td>
<td><label for="">EO사유</label></td>
<td><select name="change_option" id="change_option" class="select2" autocomplete="off"><option value="">선택</option>${code_map.change_option}</select></td>

View File

@@ -101,6 +101,9 @@ String connector = person.getUserId();
}
$('.select2').select2();
// 품번/품명 Select2 AJAX 초기화
initPartSelect2Ajax("#SEARCH_PART_NO", "#SEARCH_PART_NAME", "#SEARCH_PART_OBJID");
//첨부팝업
$(".File").click(function(){
@@ -513,14 +516,19 @@ String connector = person.getUserId();
<!-- <td> -->
<!-- <select name="upg_no" id="upg_no" class="select2" style="width:250px;" autocomplete="off"></select> -->
<!-- </td> -->
<td><label for="">품번</label></td>
<td>
<input type="text" name="SEARCH_PART_NO" id="SEARCH_PART_NO" style="width:150px;" autocomplete="off" value="${param.SEARCH_PART_NO}">
</td>
<td><label for="">품명</label></td>
<td>
<input type="text" name="SEARCH_PART_NAME" id="SEARCH_PART_NAME" style="width:150px;" autocomplete="off" value="${param.SEARCH_PART_NAME}">
</td>
<td><label for="">품번</label></td>
<td>
<select name="SEARCH_PART_NO" id="SEARCH_PART_NO" class="select2-part" style="width:150px;">
<option value="">품번 선택</option>
</select>
<input type="hidden" name="SEARCH_PART_OBJID" id="SEARCH_PART_OBJID" value="">
</td>
<td><label for="">품명</label></td>
<td>
<select name="SEARCH_PART_NAME" id="SEARCH_PART_NAME" class="select2-part" style="width:150px;">
<option value="">품명 선택</option>
</select>
</td>
<td><label for="">Revision</label></td>
<td>

View File

@@ -91,6 +91,9 @@ ui-jqgrid tr.jqgrow td {
$('.select2').select2();
// 품번/품명 Select2 AJAX 초기화
initPartSelect2Ajax("#SEARCH_PART_NO", "#SEARCH_PART_NAME", "#SEARCH_PART_OBJID");
fn_search();
@@ -610,14 +613,19 @@ ui-jqgrid tr.jqgrow td {
</c:forEach>
</select>
</td> -->
<td><label for="">품번</label></td>
<td>
<input type="text" name="SEARCH_PART_NO" id="SEARCH_PART_NO" style="width:194px;" autocomplete="off" value="${param.SEARCH_PART_NO}">
</td>
<td><label for="">품명</label></td>
<td>
<input type="text" name="SEARCH_PART_NAME" id="SEARCH_PART_NAME" style="width:150px;" autocomplete="off" value="${param.SEARCH_PART_NAME}">
</td>
<td><label for="">품번</label></td>
<td>
<select name="SEARCH_PART_NO" id="SEARCH_PART_NO" class="select2-part" style="width:194px;">
<option value="">품번 선택</option>
</select>
<input type="hidden" name="SEARCH_PART_OBJID" id="SEARCH_PART_OBJID" value="">
</td>
<td><label for="">품명</label></td>
<td>
<select name="SEARCH_PART_NAME" id="SEARCH_PART_NAME" class="select2-part" style="width:150px;">
<option value="">품명 선택</option>
</select>
</td>
<!-- <td><label for="">등록자</label></td>
<td>
<select name="WRITER" id="WRITER" required reqTitle="작성자" type="select" class="select2" autocomplete="off">

View File

@@ -176,6 +176,9 @@ $(document).ready(function(){
$('.select2').select2();
// 품번/품명 Select2 AJAX 초기화
initPartSelect2Ajax("#SEARCH_PART_NO", "#SEARCH_PART_NAME", "#SEARCH_PART_OBJID");
fn_search();
});
@@ -731,12 +734,17 @@ function saveexcelpop() {
<td class="label"><label for="">품번</label></td>
<td>
<input type="text" name="SEARCH_PART_NO" id="SEARCH_PART_NO" style="width:250px;">
<select name="SEARCH_PART_NO" id="SEARCH_PART_NO" class="select2-part" style="width:250px;">
<option value="">품번 선택</option>
</select>
<input type="hidden" name="SEARCH_PART_OBJID" id="SEARCH_PART_OBJID" value="">
</td>
<td class="label"><label for="">품명</label></td>
<td>
<input type="text" name="SEARCH_PART_NAME" id="SEARCH_PART_NAME" style="width:250px;">
<select name="SEARCH_PART_NAME" id="SEARCH_PART_NAME" class="select2-part" style="width:250px;">
<option value="">품명 선택</option>
</select>
</td>

View File

@@ -41,6 +41,9 @@ $(document).ready(function(){
_fnc_datepick(); // 날짜 선택기 초기화
$('.select2').select2(); // select2 초기화
// 품번/품명 Select2 AJAX 초기화
initPartSelect2Ajax("#search_part_no", "#search_part_name", "#search_part_objid");
// Enter 키로 검색
$("input").keyup(function(e) {
if (e.keyCode == 13) {
@@ -717,13 +720,18 @@ function fn_openPurchaseListPopup() {
<!-- 품번 -->
<div style="display: flex; align-items: center; gap: 5px;">
<label for="search_part_no">품번</label>
<input type="text" name="search_part_no" id="search_part_no" value="" style="width:150px;">
<select name="search_part_no" id="search_part_no" class="select2-part" style="width:150px;">
<option value="">품번 선택</option>
</select>
<input type="hidden" name="search_part_objid" id="search_part_objid" value="">
</div>
<!-- 품명 -->
<div style="display: flex; align-items: center; gap: 5px;">
<label for="search_part_name">품명</label>
<input type="text" name="search_part_name" id="search_part_name" value="" style="width:150px;">
<select name="search_part_name" id="search_part_name" class="select2-part" style="width:150px;">
<option value="">품명 선택</option>
</select>
</div>
<!-- 접수일 -->

View File

@@ -53,6 +53,9 @@ String connector = person.getUserId();
$(document).ready(function(){
$('.select2').select2();
// 품번/품명 Select2 AJAX 초기화
initPartSelect2Ajax("#product_item_code", "#product_item_name", "#search_part_objid");
// 요청납기일 datepicker 적용
$('#contract_start_date, #contract_end_date').datepicker({
changeMonth: true,
@@ -279,12 +282,17 @@ function openProjectFormPopUp(objId){
<td><label for="product_item_code">품번</label></td>
<td>
<input type="text" name="product_item_code" id="product_item_code" style="width:150px;" autocomplete="off" value="${param.product_item_code}">
<select name="product_item_code" id="product_item_code" class="select2-part" style="width:150px;">
<option value="">품번 선택</option>
</select>
<input type="hidden" name="search_part_objid" id="search_part_objid" value="">
</td>
<td><label for="product_item_name">품명</label></td>
<td>
<input type="text" name="product_item_name" id="product_item_name" style="width:150px;" autocomplete="off" value="${param.product_item_name}">
<select name="product_item_name" id="product_item_name" class="select2-part" style="width:150px;">
<option value="">품명 선택</option>
</select>
</td>
<td><label for="serial_no">S/N</label></td>

View File

@@ -48,6 +48,9 @@ $(document).ready(function(){
$('.select2').select2();
fnc_datepick();
// 품번/품명 Select2 AJAX 초기화
initPartSelect2Ajax("#SEARCH_PART_NO", "#SEARCH_PART_NAME", "#SEARCH_PART_OBJID");
$("input").keyup(function(e){
if(e.keyCode == 13){
$("#page").val("1");
@@ -484,7 +487,9 @@ function fn_purchaseClose(){
<td><label for="">품명</label></td>
<td>
<input type="text" name="SEARCH_PART_NAME" id="SEARCH_PART_NAME" style="width:130px;" autocomplete="off" value="${param.SEARCH_PART_NAME}">
<select name="SEARCH_PART_NAME" id="SEARCH_PART_NAME" class="select2-part" style="width:130px;">
<option value="">품명 선택</option>
</select>
</td>
</tr>
<tr>
@@ -516,7 +521,12 @@ function fn_purchaseClose(){
</select>
</td>
<td><label for="">품번</label></td>
<td><input type="text" name="SEARCH_PART_NO" id="SEARCH_PART_NO" autocomplete="off" value="${param.SEARCH_PART_NO }" style="width:120px;"/></td>
<td>
<select name="SEARCH_PART_NO" id="SEARCH_PART_NO" class="select2-part" style="width:120px;">
<option value="">품번 선택</option>
</select>
<input type="hidden" name="SEARCH_PART_OBJID" id="SEARCH_PART_OBJID" value="">
</td>
</tr>
</table>
</div>

View File

@@ -42,6 +42,9 @@ $(document).ready(function(){
$('.select2').select2();
fnc_datepick();
// 품번/품명 Select2 AJAX 초기화
initPartSelect2Ajax("#SEARCH_PART_NO", "#SEARCH_PART_NAME", "#SEARCH_PART_OBJID");
//조회
@@ -872,12 +875,17 @@ function fn_openMailFormPopup(purchaseOrderObjId){
<td><label for="">품번</label></td>
<td>
<input type="text" name="SEARCH_PART_NO" id="SEARCH_PART_NO" style="" autocomplete="off" value="${param.SEARCH_PART_NO}">
<select name="SEARCH_PART_NO" id="SEARCH_PART_NO" class="select2-part" style="width:150px;">
<option value="">품번 선택</option>
</select>
<input type="hidden" name="SEARCH_PART_OBJID" id="SEARCH_PART_OBJID" value="">
</td>
<td><label for="">품명</label></td>
<td>
<input type="text" name="SEARCH_PART_NAME" id="SEARCH_PART_NAME" style="" autocomplete="off" value="${param.SEARCH_PART_NAME}">
<select name="SEARCH_PART_NAME" id="SEARCH_PART_NAME" class="select2-part" style="width:150px;">
<option value="">품명 선택</option>
</select>
</td>
<%-- 발주부품, 발주구분 주석처리

View File

@@ -36,6 +36,9 @@ $(document).ready(function(){
$('.select2').select2();
fnc_datepick();
// 품번/품명 Select2 AJAX 초기화
initPartSelect2Ajax("#search_product_no", "#search_product_name", "#search_product_objid");
$("input").keyup(function(e){
if(e.keyCode == 13){
$("#page").val("1");
@@ -276,9 +279,18 @@ function fn_FileRegist(objId, docType, docTypeName){
</select>
</td> -->
<td><label>품번</label></td>
<td><input type="text" name="search_product_no" id="search_product_no" style="" autocomplete="off"></td>
<td>
<select name="search_product_no" id="search_product_no" class="select2-part" style="width:150px;">
<option value="">품번 선택</option>
</select>
<input type="hidden" name="search_product_objid" id="search_product_objid" value="">
</td>
<td><label>품명</label></td>
<td><input type="text" name="search_product_name" id="search_product_name" style="" autocomplete="off"></td>
<td>
<select name="search_product_name" id="search_product_name" class="select2-part" style="width:150px;">
<option value="">품명 선택</option>
</select>
</td>
<td><label>부품품번</label></td>
<td><input type="text" name="search_part_no" id="search_part_no" style="width:215px;" autocomplete="off"></td>
<td><label>부품품명</label></td>

View File

@@ -58,6 +58,9 @@ $(document).ready(function(){
$('.select2').select2();
fnc_datepick();
// 품번/품명 Select2 AJAX 초기화
initPartSelect2Ajax("#search_part_no", "#search_part_name", "#search_part_objid");
$("input").keyup(function(e){
if(e.keyCode == 13){
$("#page").val("1");
@@ -239,10 +242,19 @@ function fn_deliveryAcceptanceViewPopUp(objId,DELIVERY_STATUS){
</td>
<td><label for="">품번</label></td>
<td><input type="text" name="search_part_no" id="search_part_no" style="width:170px;" autocomplete="off" value="${param.search_part_no}"></td>
<td>
<select name="search_part_no" id="search_part_no" class="select2-part" style="width:170px;">
<option value="">품번 선택</option>
</select>
<input type="hidden" name="search_part_objid" id="search_part_objid" value="">
</td>
<td><label for="">품명</label></td>
<td><input type="text" name="search_part_name" id="search_part_name" style="width:170px;" autocomplete="off" value="${param.search_part_name}"></td>
<td>
<select name="search_part_name" id="search_part_name" class="select2-part" style="width:170px;">
<option value="">품명 선택</option>
</select>
</td>
<td><label for="">공급업체</label></td>
<td><select name="search_partner" id="search_partner" class="select2" autocomplete="off" style="width:250px;"><option value="">선택</option>${code_map.partner_objid}</select></td>

View File

@@ -58,6 +58,9 @@ $(document).ready(function(){
$('.select2').select2();
fnc_datepick();
// 품번/품명 Select2 AJAX 초기화
initPartSelect2Ajax("#search_part_no", "#search_part_name", "#search_part_objid");
$("input").keyup(function(e){
if(e.keyCode == 13){
$("#page").val("1");
@@ -300,10 +303,19 @@ function fn_deliveryAcceptanceViewPopUp(objId,DELIVERY_STATUS){
</td>
<td><label for="">품번</label></td>
<td><input type="text" name="search_part_no" id="search_part_no" style="width:170px;" autocomplete="off" value="${param.search_part_no}"></td>
<td>
<select name="search_part_no" id="search_part_no" class="select2-part" style="width:170px;">
<option value="">품번 선택</option>
</select>
<input type="hidden" name="search_part_objid" id="search_part_objid" value="">
</td>
<td><label for="">품명</label></td>
<td><input type="text" name="search_part_name" id="search_part_name" style="width:170px;" autocomplete="off" value="${param.search_part_name}"></td>
<td>
<select name="search_part_name" id="search_part_name" class="select2-part" style="width:170px;">
<option value="">품명 선택</option>
</select>
</td>
<td><label for="">공급업체</label></td>
<td><select name="search_partner" id="search_partner" class="select2" autocomplete="off" style="width:250px;"><option value="">선택</option>${code_map.partner_objid}</select></td>

View File

@@ -45,6 +45,9 @@ String menuName = CommonUtils.getMenuName(menuObjId, "구매관리_구매요청
$(document).ready(function(){
$('.select2').select2();
// 품번/품명 Select2 AJAX 초기화
initPartSelect2Ajax("#SEARCH_PART_NO", "#SEARCH_PART_NAME", "#SEARCH_PART_OBJID");
$("input[type=text]").keyup(function(e){
if(e.keyCode == 13){
$("#btnSearch").trigger("click");
@@ -710,20 +713,25 @@ function fn_executeCreateProposal(salesRequestObjid, targetParts) {
<select name="SEARCH_PRODUCT_CODE" id="SEARCH_PRODUCT_CODE" style="" class="select2" autocomplete="off"></select>
</td> -->
<%-- 품번 활성화 --%>
<td class="align_r">
<label for="" class="">품번</label>
</td>
<td>
<input type="text" name="SEARCH_PART_NO" id="SEARCH_PART_NO" value="${param.SEARCH_PART_NO}" style="width:200px;"/>
</td>
<%-- 품명 활성화 --%>
<td class="align_r">
<label for="" class="">품명</label>
</td>
<td>
<input type="text" name="SEARCH_PART_NAME" id="SEARCH_PART_NAME" value="${param.SEARCH_PART_NAME}" style="width:200px;"/>
</td>
<%-- 품번 활성화 --%>
<td class="align_r">
<label for="" class="">품번</label>
</td>
<td>
<select name="SEARCH_PART_NO" id="SEARCH_PART_NO" class="select2-part" style="width:200px;">
<option value="">품번 선택</option>
</select>
<input type="hidden" name="SEARCH_PART_OBJID" id="SEARCH_PART_OBJID" value="">
</td>
<%-- 품명 활성화 --%>
<td class="align_r">
<label for="" class="">품명</label>
</td>
<td>
<select name="SEARCH_PART_NAME" id="SEARCH_PART_NAME" class="select2-part" style="width:200px;">
<option value="">품명 선택</option>
</select>
</td>
<%-- 상태 주석처리
<td class="align_r">
<label for="" class="">상태</label>

View File

@@ -2955,7 +2955,6 @@ public class PurchaseOrderService {
try {
String targetObjId = CommonUtils.checkNull(paramMap.get("objId"));
String pdfSessionId = CommonUtils.checkNull(paramMap.get("pdfSessionId")); // PDF 세션 ID 추가
String toEmails = CommonUtils.checkNull(paramMap.get("toEmails"));
String ccEmails = CommonUtils.checkNull(paramMap.get("ccEmails"));
String subject = CommonUtils.checkNull(paramMap.get("subject"));
@@ -2988,7 +2987,9 @@ public class PurchaseOrderService {
Calendar cal = Calendar.getInstance();
String todayKor = frm.format(cal.getTime());
String poNo = CommonUtils.checkNull((String)masterInfo.get("PURCHASE_ORDER_NO"));
String excelName = "발주서_" + poNo + "_" + todayKor + ".xls";
String zipName = "도면_" + poNo + "_" + todayKor + ".zip";
masterInfo.put("EXCELFILE_NAME", excelName);
masterInfo.put("APPR_COMPLETE_DATE", frm2.format(cal.getTime()));
// 발주서 테이블 내용 생성
@@ -3028,30 +3029,11 @@ public class PurchaseOrderService {
// 첨부파일 목록 생성
ArrayList<HashMap> attachFileList = new ArrayList<HashMap>();
// 1. 발주서 PDF 파일 첨부
if(!"".equals(pdfSessionId)) {
File pdfFile = getPdfFromSession(pdfSessionId, poNo);
if(pdfFile != null && pdfFile.exists()) {
HashMap<String, String> pdfFileMap = new HashMap<String, String>();
pdfFileMap.put(Constants.Db.COL_FILE_REAL_NAME, pdfFile.getName());
pdfFileMap.put(Constants.Db.COL_FILE_SAVED_NAME, pdfFile.getName());
pdfFileMap.put(Constants.Db.COL_FILE_PATH, pdfFile.getParent());
attachFileList.add(pdfFileMap);
System.out.println("발주서 PDF 파일 첨부 완료: " + pdfFile.getAbsolutePath());
} else {
System.out.println("발주서 PDF 파일을 찾을 수 없습니다: " + pdfSessionId);
}
}
/* 엑셀 첨부 주석처리 - PDF로 대체
// 1. 발주서 엑셀 파일 첨부
String excelName = "발주서_" + poNo + "_" + todayKor + ".xls";
masterInfo.put("EXCELFILE_NAME", excelName);
HashMap excelFile = this.makeMailAttachFileOrderSheet(masterInfo, contents_table);
if(excelFile != null) {
attachFileList.add(excelFile);
}
*/
// 2. 도면 파일 압축 첨부
if(partFileList != null && partFileList.size() > 0) {
@@ -3061,7 +3043,7 @@ public class PurchaseOrderService {
hm.put(Constants.Db.COL_FILE_REAL_NAME, zf.getName());
hm.put(Constants.Db.COL_FILE_SAVED_NAME, zf.getName());
// 파일 경로에서 파일명을 제거하고 디렉토리 경로만 추출 (OS 독립적)
hm.put(Constants.Db.COL_FILE_PATH, zf.getParent());
hm.put(Constants.Db.COL_FILE_PATH, zf.getParent());
attachFileList.add(hm);
}
}
@@ -3076,8 +3058,7 @@ public class PurchaseOrderService {
fromUser = CommonUtils.checkNull((String)masterInfo.get("WRITER"));
}
// 구매팀 계정(PURCHASE) 사용
boolean sendResult = MailUtil.sendMailWithAttachFile(fromUser, fromEmail, toUserIdList, toEmailList, ccEmailList, null, null, subject, mailContents, attachFileList, "PURCHASE_ORDER", Constants.Mail.ACCOUNT_TYPE_PURCHASE);
boolean sendResult = MailUtil.sendMailWithAttachFile(fromUser, fromEmail, toUserIdList, toEmailList, ccEmailList, null, null, subject, mailContents, attachFileList, "PURCHASE_ORDER");
if(sendResult) {
// 메일 발송 성공 시 DB 업데이트
@@ -3138,7 +3119,6 @@ public class PurchaseOrderService {
sb.append(userContents.replace("\n", "<br>"));
sb.append("</div>");
/* 발주서 테이블 본문 표시 주석처리 - PDF 첨부로 대체
// 구분선
sb.append("<hr style='border: 1px solid #ddd; margin: 20px 0;'>");
@@ -3147,7 +3127,6 @@ public class PurchaseOrderService {
sb.append("<h3 style='margin-bottom: 10px;'>[ 발주서 상세 ]</h3>");
sb.append(poContentsTable);
sb.append("</div>");
*/
sb.append("<div style='margin-top: 20px; color: #666;'>※발신전용 메일입니다.</div>");
sb.append("</body>");
@@ -3198,45 +3177,4 @@ public class PurchaseOrderService {
}
return resultMap;
}
/**
* 세션 ID로 저장된 PDF 파일 가져오기
* @param sessionId PDF 세션 ID
* @param poNo 발주번호 (파일명에 사용)
* @return PDF 파일
*/
private File getPdfFromSession(String sessionId, String poNo) {
try {
String tempDir = System.getProperty("java.io.tmpdir");
File pdfFile = new File(tempDir + File.separator + sessionId + ".pdf");
if(pdfFile.exists()) {
// 발주번호로 파일명 변경
if("".equals(poNo)) poNo = "발주서";
java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyyMMddHHmmss");
String timestamp = sdf.format(new java.util.Date());
String newFileName = "발주서_" + poNo + "_" + timestamp + ".pdf";
File renamedFile = new File(tempDir + File.separator + newFileName);
// 파일 복사
java.nio.file.Files.copy(pdfFile.toPath(), renamedFile.toPath(),
java.nio.file.StandardCopyOption.REPLACE_EXISTING);
renamedFile.deleteOnExit();
// 원본 파일 삭제
pdfFile.delete();
return renamedFile;
}
return null;
} catch(Exception e) {
System.out.println("PDF 파일 가져오기 중 오류: " + e.getMessage());
e.printStackTrace();
return null;
}
}
}