diff --git a/WebContent/WEB-INF/view/salesMng/quotationRequestMailPopup.jsp b/WebContent/WEB-INF/view/salesMng/quotationRequestMailPopup.jsp index 5311ad8..0f954a2 100644 --- a/WebContent/WEB-INF/view/salesMng/quotationRequestMailPopup.jsp +++ b/WebContent/WEB-INF/view/salesMng/quotationRequestMailPopup.jsp @@ -273,6 +273,7 @@ function fn_generateMailTemplate(){ var template = "안녕하세요.\n\n"; template += vendorName + " 귀하\n\n"; template += "아래와 같이 견적을 요청드립니다.\n\n"; + template += "각 품목별 납품가능일 표기 부탁드립니다.\n\n"; template += "견적요청번호: " + quotationNo + "\n"; if(projectNo !== ""){ template += "프로젝트번호: " + projectNo + "\n"; diff --git a/WebContent/WEB-INF/view/salesmgmt/salesMgmt/revenueMgmtList.jsp b/WebContent/WEB-INF/view/salesmgmt/salesMgmt/revenueMgmtList.jsp index 82a5998..b57b6a4 100644 --- a/WebContent/WEB-INF/view/salesmgmt/salesMgmt/revenueMgmtList.jsp +++ b/WebContent/WEB-INF/view/salesmgmt/salesMgmt/revenueMgmtList.jsp @@ -69,6 +69,142 @@ fn_search(); }); + // 마감정보입력 버튼 + $("#btnDeadlineInfo").click(function(){ + var targetObj = _tabulGrid.getSelectedData(); + + if(0 == targetObj.length){ + Swal.fire("선택된 내용이 없습니다."); + return false; + } + + // 선택된 OBJID 목록 + var objIdList = []; + for(var i = 0; i < targetObj.length; i++){ + objIdList.push(fnc_checkNull(targetObj[i].OBJID)); + } + + // 단건 선택 시 기존 마감정보 불러오기 + var loadExisting = (targetObj.length === 1); + + function openDeadlineInfoPopup(existingInfo) { + var taxType = (existingInfo && existingInfo.TAX_TYPE) ? existingInfo.TAX_TYPE : ''; + var taxInvoiceDate = (existingInfo && existingInfo.TAX_INVOICE_DATE) ? existingInfo.TAX_INVOICE_DATE : ''; + var exportDeclNo = (existingInfo && existingInfo.EXPORT_DECL_NO) ? existingInfo.EXPORT_DECL_NO : ''; + var loadingDate = (existingInfo && existingInfo.LOADING_DATE) ? existingInfo.LOADING_DATE : ''; + + // hidden select에서 과세구분 옵션 HTML 가져오기 + var taxTypeOptionsHtml = $('#hiddenTaxTypeList').html(); + + Swal.fire({ + title: '마감정보입력', + width: '600px', + html: + '
' + + '' + + '' + + ' ' + + ' ' + + '' + + '' + + ' ' + + ' ' + + '' + + '' + + ' ' + + ' ' + + '' + + '' + + ' ' + + ' ' + + '' + + '
과세구분' + + ' ' + + '
세금계산서발행일
수출신고필증신고번호
선적일자
' + + '
선택된 ' + targetObj.length + '건의 데이터에 마감정보를 입력합니다.
' + + '
', + showCancelButton: true, + confirmButtonColor: '#2196F3', + cancelButtonColor: '#666', + confirmButtonText: '저장', + cancelButtonText: '닫기', + onOpen: function() { + // 날짜 필드 datepicker 초기화 + $('#swal_taxInvoiceDate').datepicker({ + dateFormat: 'yy-mm-dd', + changeMonth: true, + changeYear: true + }); + $('#swal_loadingDate').datepicker({ + dateFormat: 'yy-mm-dd', + changeMonth: true, + changeYear: true + }); + // 기존 데이터 세팅 + if(taxType) $('#swal_taxType').val(taxType); + if(taxInvoiceDate) $('#swal_taxInvoiceDate').val(taxInvoiceDate); + if(exportDeclNo) $('#swal_exportDeclNo').val(exportDeclNo); + if(loadingDate) $('#swal_loadingDate').val(loadingDate); + }, + preConfirm: function() { + return { + taxType: $('#swal_taxType').val(), + taxInvoiceDate: $('#swal_taxInvoiceDate').val(), + exportDeclNo: $('#swal_exportDeclNo').val(), + loadingDate: $('#swal_loadingDate').val() + }; + } + }).then(function(result) { + if (result.isConfirmed) { + var formData = result.value; + + $.ajax({ + url: "/revenueMgmt/saveDeadlineInfo.do", + type: "POST", + data: { + "objIdList": objIdList.join(','), + "taxType": formData.taxType, + "taxInvoiceDate": formData.taxInvoiceDate, + "exportDeclNo": formData.exportDeclNo, + "loadingDate": formData.loadingDate + }, + dataType: "json", + success: function(data){ + Swal.fire({ + title: data.msg || '처리되었습니다.', + icon: data.result ? 'success' : 'error' + }).then(function() { + if(data.result) fn_search(); + }); + }, + error: function(jqxhr, status, error){ + Swal.fire({ + title: '마감정보 저장 중 오류가 발생했습니다.', + text: error || jqxhr.statusText || '서버 오류', + icon: 'error' + }); + } + }); + } + }); + } + + // 단건 선택 시 그리드 데이터에서 기존 마감정보 가져오기 + if(loadExisting) { + var row = targetObj[0]; + openDeadlineInfoPopup({ + TAX_TYPE: fnc_checkNull(row.TAX_TYPE), + TAX_INVOICE_DATE: fnc_checkNull(row.TAX_INVOICE_DATE), + EXPORT_DECL_NO: fnc_checkNull(row.EXPORT_DECL_NO), + LOADING_DATE: fnc_checkNull(row.LOADING_DATE) + }); + } else { + openDeadlineInfoPopup(null); + } + }); + $("#btnDeadline").click(function(){ var targetObj = _tabulGrid.getSelectedData(); @@ -295,6 +431,14 @@ var columns = [ {headerHozAlign : 'center', hozAlign : 'left', width : '100', title : 'S/N', field : 'SERIAL_NO'}, // 20. 품번 {headerHozAlign : 'center', hozAlign : 'left', width : '100', title : '품번', field : 'PRODUCT_NO'}, + // 21. 과세구분 + {headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '과세구분', field : 'TAX_TYPE_NAME'}, + // 22. 세금계산서발행일 + {headerHozAlign : 'center', hozAlign : 'center', width : '110', title : '세금계산서발행일', field : 'TAX_INVOICE_DATE'}, + // 23. 수출신고필증신고번호 + {headerHozAlign : 'center', hozAlign : 'left', width : '140', title : '수출신고필증신고번호', field : 'EXPORT_DECL_NO'}, + // 24. 선적일자 + {headerHozAlign : 'center', hozAlign : 'center', width : '90', title : '선적일자', field : 'LOADING_DATE'}, /* 주석처리된 컬럼 - 필요시 활성화 */ /* @@ -467,6 +611,11 @@ function fn_FileRegist(objId, docType, docTypeName){
+ +
@@ -476,6 +625,7 @@ function fn_FileRegist(objId, docType, docTypeName){
+
diff --git a/src/com/pms/mapper/admin.xml b/src/com/pms/mapper/admin.xml index b72f70f..577c635 100644 --- a/src/com/pms/mapper/admin.xml +++ b/src/com/pms/mapper/admin.xml @@ -9383,7 +9383,7 @@ SELECT - SELECT OBJID, MATERIAL_CODE, @@ -9394,8 +9394,21 @@ SELECT ORDER BY MATERIAL_CODE + + - SELECT OBJID, MATERIAL_CODE, @@ -9407,8 +9420,21 @@ SELECT ORDER BY SIZE_SPEC + + - SELECT OBJID, MATERIAL_CODE, @@ -9422,6 +9448,21 @@ SELECT LIMIT 1 + + + + + + + + + /* salesNcollectMgmt.saveDeadlineInfo - 마감정보 저장 */ + UPDATE PROJECT_MGMT + SET + TAX_TYPE = #{taxType}, + TAX_INVOICE_DATE = #{taxInvoiceDate}, + EXPORT_DECL_NO = #{exportDeclNo}, + LOADING_DATE = #{loadingDate} + WHERE OBJID::VARCHAR = #{OBJID} + diff --git a/src/com/pms/salesmgmt/service/SalesNcollectMgmtService.java b/src/com/pms/salesmgmt/service/SalesNcollectMgmtService.java index a3fb2d7..895f547 100644 --- a/src/com/pms/salesmgmt/service/SalesNcollectMgmtService.java +++ b/src/com/pms/salesmgmt/service/SalesNcollectMgmtService.java @@ -1456,4 +1456,76 @@ public Map saveSaleRegistration(HttpServletRequest request, Map< return result; } + + /** + * 마감정보 조회 + * @param paramMap - OBJID + * @return 마감정보 Map (TAX_TYPE, TAX_INVOICE_DATE, EXPORT_DECL_NO, LOADING_DATE) + */ + public Map getDeadlineInfo(Map paramMap) { + Map resultMap = new HashMap(); + SqlSession sqlSession = null; + try { + sqlSession = SqlMapConfig.getInstance().getSqlSession(); + Map info = sqlSession.selectOne("salesNcollectMgmt.getDeadlineInfo", paramMap); + resultMap.put("result", true); + resultMap.put("info", info); + } catch (Exception e) { + resultMap.put("result", false); + resultMap.put("msg", "마감정보 조회 중 오류가 발생했습니다."); + e.printStackTrace(); + } finally { + if (sqlSession != null) sqlSession.close(); + } + return resultMap; + } + + /** + * 마감정보 저장 (선택된 항목들에 일괄 적용) + * @param request + * @param paramMap - objIdList, taxType, taxInvoiceDate, exportDeclNo, loadingDate + * @return 처리 결과 + */ + public Map saveDeadlineInfo(HttpServletRequest request, Map paramMap) { + Map resultMap = new HashMap(); + SqlSession sqlSession = SqlMapConfig.getInstance().getSqlSession(false); + try { + String objIdListStr = CommonUtils.checkNull(paramMap.get("objIdList")); + String taxType = CommonUtils.checkNull(paramMap.get("taxType")); + String taxInvoiceDate = CommonUtils.checkNull(paramMap.get("taxInvoiceDate")); + String exportDeclNo = CommonUtils.checkNull(paramMap.get("exportDeclNo")); + String loadingDate = CommonUtils.checkNull(paramMap.get("loadingDate")); + + if (objIdListStr == null || objIdListStr.isEmpty()) { + resultMap.put("result", false); + resultMap.put("msg", "선택된 항목이 없습니다."); + return resultMap; + } + + String[] targetObjIdList = objIdListStr.split(","); + sqlSession = SqlMapConfig.getInstance().getSqlSession(); + + for (int i = 0; i < targetObjIdList.length; i++) { + HashMap sqlParamMap = new HashMap(); + sqlParamMap.put("OBJID", CommonUtils.checkNull(targetObjIdList[i])); + sqlParamMap.put("taxType", taxType); + sqlParamMap.put("taxInvoiceDate", taxInvoiceDate); + sqlParamMap.put("exportDeclNo", exportDeclNo); + sqlParamMap.put("loadingDate", loadingDate); + + sqlSession.update("salesNcollectMgmt.saveDeadlineInfo", sqlParamMap); + } + sqlSession.commit(); + resultMap.put("result", true); + resultMap.put("msg", targetObjIdList.length + "건의 마감정보가 저장되었습니다."); + } catch (Exception e) { + resultMap.put("result", false); + resultMap.put("msg", "마감정보 저장 중 오류가 발생했습니다."); + sqlSession.rollback(); + e.printStackTrace(); + } finally { + sqlSession.close(); + } + return resultMap; + } }