Merge pull request 'V20260210' (#178) from V20260210 into main

Reviewed-on: #178
This commit was merged in pull request #178.
This commit is contained in:
2026-03-20 05:29:49 +00:00
6 changed files with 312 additions and 2 deletions

View File

@@ -1168,6 +1168,21 @@
WHERE OBJID = #{OBJID}
</update>
<!-- arrival_plan 마감정보 저장 -->
<update id="saveArrivalPlanDeadlineInfo" parameterType="map">
/* purchaseOrder.saveArrivalPlanDeadlineInfo - 입고건별 마감정보 저장 */
UPDATE arrival_plan SET
tax_type = #{taxType}
<if test="taxInvoiceDate != null and taxInvoiceDate != ''">, tax_invoice_date = #{taxInvoiceDate}</if>
<if test="exportDeclNo != null">, export_decl_no = #{exportDeclNo}</if>
<if test="loadingDate != null and loadingDate != ''">, loading_date = #{loadingDate}</if>
<if test="foreignType != null and foreignType != ''">, foreign_type = #{foreignType}</if>
<if test="duty != null and duty != ''">, duty = CAST(#{duty} AS NUMERIC)</if>
<if test="exchangeRate != null and exchangeRate != ''">, exchange_rate = CAST(#{exchangeRate} AS NUMERIC)</if>
<if test="importVat != null and importVat != ''">, import_vat = CAST(#{importVat} AS NUMERIC)</if>
WHERE OBJID = #{OBJID}
</update>
<update id="updatePurchaseOrderMasterPriceAll" parameterType="map">
UPDATE PURCHASE_ORDER_MASTER SET
TOTAL_PRICE_TXT_ALL = NUM_TO_KOR((T.REAL_SUPPLY_PRICE_VAT)::varchar,'일금 ',' 원정 (₩ ') || TRIM(TO_CHAR((T.REAL_SUPPLY_PRICE_VAT), '999,999,999,999')) ||')'
@@ -6608,6 +6623,16 @@ FROM(
<!-- 매입마감일 (입고건 단위) -->
,AP.PURCHASE_CLOSE_DATE
<!-- 마감정보 -->
,COALESCE(AP.tax_type, '') AS TAX_TYPE
,COALESCE(AP.tax_invoice_date, '') AS TAX_INVOICE_DATE
,COALESCE(AP.export_decl_no, '') AS EXPORT_DECL_NO
,COALESCE(AP.loading_date, '') AS LOADING_DATE
,COALESCE(AP.foreign_type, '') AS FOREIGN_TYPE
,COALESCE(AP.duty, 0) AS DUTY
,COALESCE(AP.exchange_rate, 0) AS EXCHANGE_RATE
,COALESCE(AP.import_vat, 0) AS IMPORT_VAT
FROM ARRIVAL_PLAN AP
INNER JOIN PURCHASE_ORDER_MASTER POM ON POM.OBJID = AP.PARENT_OBJID
INNER JOIN PURCHASE_ORDER_PART POP ON POP.PURCHASE_ORDER_MASTER_OBJID = POM.OBJID::VARCHAR

View File

@@ -69,6 +69,187 @@ $(document).ready(function(){
$("#project_no").change(function(){
fn_UnitCodeList(this.value, "unit_code", "");
});
// 마감정보입력 버튼
$("#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].ARRIVAL_PLAN_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 : '';
var foreignType = (existingInfo && existingInfo.FOREIGN_TYPE) ? existingInfo.FOREIGN_TYPE : '';
var duty = (existingInfo && existingInfo.DUTY) ? existingInfo.DUTY : '';
var importVat = (existingInfo && existingInfo.IMPORT_VAT) ? existingInfo.IMPORT_VAT : '';
var exchangeRate = (existingInfo && existingInfo.EXCHANGE_RATE) ? existingInfo.EXCHANGE_RATE : '';
// hidden select에서 과세구분 옵션 HTML 가져오기
var taxTypeOptionsHtml = $('#hiddenTaxTypeList').html();
// hidden select에서 국내/해외 옵션 HTML 가져오기
var foreignTypeOptionsHtml = $('#hiddenForeignTypeList').html();
Swal.fire({
title: '마감정보입력',
width: '600px',
html:
'<div style="padding:10px;">' +
'<table style="width:100%; border-collapse:collapse;">' +
'<tr>' +
' <td style="padding:8px; text-align:right; width:40%; font-weight:bold; border:1px solid #ddd; background:#f5f5f5;">국내/해외</td>' +
' <td style="padding:8px; border:1px solid #ddd;">' +
' <select id="swal_foreignType" style="width:100%; padding:5px;">' +
foreignTypeOptionsHtml +
' </select>' +
' </td>' +
'</tr>' +
'<tr>' +
' <td style="padding:8px; text-align:right; width:40%; font-weight:bold; border:1px solid #ddd; background:#f5f5f5;">환율</td>' +
' <td style="padding:8px; border:1px solid #ddd;"><input type="text" id="swal_exchangeRate" style="width:95%; padding:5px;"></td>' +
'</tr>' +
'<tr>' +
' <td style="padding:8px; text-align:right; width:40%; font-weight:bold; border:1px solid #ddd; background:#f5f5f5;">과세구분</td>' +
' <td style="padding:8px; border:1px solid #ddd;">' +
' <select id="swal_taxType" style="width:100%; padding:5px;">' +
taxTypeOptionsHtml +
' </select>' +
' </td>' +
'</tr>' +
'<tr>' +
' <td style="padding:8px; text-align:right; font-weight:bold; border:1px solid #ddd; background:#f5f5f5;">세금계산서발행일</td>' +
' <td style="padding:8px; border:1px solid #ddd;"><input type="text" id="swal_taxInvoiceDate" style="width:95%; padding:5px;" placeholder="YYYY-MM-DD" readonly></td>' +
'</tr>' +
'<tr>' +
' <td style="padding:8px; text-align:right; font-weight:bold; border:1px solid #ddd; background:#f5f5f5;">수출신고필증신고번호</td>' +
' <td style="padding:8px; border:1px solid #ddd;"><input type="text" id="swal_exportDeclNo" style="width:95%; padding:5px;"></td>' +
'</tr>' +
'<tr>' +
' <td style="padding:8px; text-align:right; font-weight:bold; border:1px solid #ddd; background:#f5f5f5;">선적일자</td>' +
' <td style="padding:8px; border:1px solid #ddd;"><input type="text" id="swal_loadingDate" style="width:95%; padding:5px;" placeholder="YYYY-MM-DD" readonly></td>' +
'</tr>' +
'<tr>' +
' <td style="padding:8px; text-align:right; width:40%; font-weight:bold; border:1px solid #ddd; background:#f5f5f5;">관세</td>' +
' <td style="padding:8px; border:1px solid #ddd;"><input type="text" id="swal_duty" style="width:95%; padding:5px;"></td>' +
'</tr>' +
'<tr>' +
' <td style="padding:8px; text-align:right; width:40%; font-weight:bold; border:1px solid #ddd; background:#f5f5f5;">수입부가세</td>' +
' <td style="padding:8px; border:1px solid #ddd;"><input type="text" id="swal_importVat" style="width:95%; padding:5px;"></td>' +
'</tr>' +
'</table>' +
'<div style="margin-top:10px; color:#666; font-size:12px;">선택된 ' + targetObj.length + '건의 데이터에 마감정보를 입력합니다.</div>' +
'</div>',
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);
if(foreignType) $('#swal_foreignType').val(foreignType);
if(duty) $('#swal_duty').val(duty);
if(importVat) $('#swal_importVat').val(importVat);
if(exchangeRate) $('#swal_exchangeRate').val(exchangeRate);
},
preConfirm: function() {
return {
taxType: $('#swal_taxType').val(),
taxInvoiceDate: $('#swal_taxInvoiceDate').val(),
exportDeclNo: $('#swal_exportDeclNo').val(),
loadingDate: $('#swal_loadingDate').val(),
foreignType: $('#swal_foreignType').val(),
duty: $('#swal_duty').val(),
importVat: $('#swal_importVat').val(),
exchangeRate: $('#swal_exchangeRate').val()
};
}
}).then(function(result) {
if (result.isConfirmed) {
var formData = result.value;
$.ajax({
url: "/purchaseOrder/saveArrivalPlanDeadlineInfo.do",
type: "POST",
data: {
"objIdList": objIdList.join(','),
"taxType": formData.taxType,
"taxInvoiceDate": formData.taxInvoiceDate,
"exportDeclNo": formData.exportDeclNo,
"loadingDate": formData.loadingDate,
"foreignType": formData.foreignType,
"duty": formData.duty,
"importVat": formData.importVat,
"exchangeRate": formData.exchangeRate
},
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),
FOREIGN_TYPE: fnc_checkNull(row.FOREIGN_TYPE),
DUTY: fnc_checkNull(row.DUTY),
EXCHANGE_RATE: fnc_checkNull(row.EXCHANGE_RATE),
IMPORT_VAT: fnc_checkNull(row.IMPORT_VAT)
});
} else {
openDeadlineInfoPopup(null);
}
});
fn_search();
});
@@ -279,7 +460,17 @@ function fn_purchaseClose(){
</form>
<form name="form1" id="form1" action="" method="post">
<textarea style="width:0px; height:0px; visibility: hidden;" id="jsonLevel3_csmCategory">${code_map.jsonLevel3_csmCategory}</textarea>
<select id="hiddenTaxTypeList" style="display:none;">
<option value="">선택</option>
<option value="0900218">과세매입</option>
<option value="0900219">영세매입</option>
<option value="0900220">수입</option>
</select>
<select id="hiddenForeignTypeList" style="display:none;">
<option value="">선택</option>
<option value="0001220">국내</option>
<option value="0001221">해외</option>
</select>
<div class="content-box" style="height: 99.3%;">
<div class="content-box-s">
<div class="plm_menu_name_gdnsi">
@@ -288,6 +479,7 @@ function fn_purchaseClose(){
</h2>
<div class="btnArea">
<input type="button" class="plm_btns" value="조회" id="btnSearch">
<input type="button" class="plm_btns"value="마감정보입력" id="btnDeadlineInfo" style="background-color: #2196F3; color: white;">
<input type="button" class="plm_btns" value="매입마감" id="btnClose">
</div>
</div>

View File

@@ -53,7 +53,7 @@ echo "DEBUG: Effective classpath for javac: $EFFECTIVE_CLASSPATH"
# src 폴더 내의 모든 .java 파일 컴파일
echo "Compiling Java files for development..."
find src -name "*.java" -print0 | xargs -0 javac -encoding UTF-8 -source 1.8 -target 1.8 -d WebContent/WEB-INF/classes -cp "$EFFECTIVE_CLASSPATH"
find src -name "*.java" -print0 | xargs -0 javac -encoding UTF-8 -source 1.7 -target 1.7 -d WebContent/WEB-INF/classes -cp "$EFFECTIVE_CLASSPATH"
if [ $? -ne 0 ]; then
echo "Java compilation failed. Exiting script."
exit 1

View File

@@ -1633,6 +1633,16 @@ public class PurchaseOrderController {
return paramMap;
}
/**
* 입고건별 마감정보 저장
*/
@ResponseBody
@RequestMapping("/purchaseOrder/saveArrivalPlanDeadlineInfo.do")
public Map saveArrivalPlanDeadlineInfo(HttpSession session, HttpServletRequest request, @RequestParam Map paramMap) {
return purchaseOrderService.saveArrivalPlanDeadlineInfo(request, paramMap);
}
/**
* 매입마감 관리 화면 (입고일별 입고관리)
*/

View File

@@ -1168,6 +1168,21 @@
WHERE OBJID = #{OBJID}
</update>
<!-- arrival_plan 마감정보 저장 -->
<update id="saveArrivalPlanDeadlineInfo" parameterType="map">
/* purchaseOrder.saveArrivalPlanDeadlineInfo - 입고건별 마감정보 저장 */
UPDATE arrival_plan SET
tax_type = #{taxType}
<if test="taxInvoiceDate != null and taxInvoiceDate != ''">, tax_invoice_date = #{taxInvoiceDate}</if>
<if test="exportDeclNo != null">, export_decl_no = #{exportDeclNo}</if>
<if test="loadingDate != null and loadingDate != ''">, loading_date = #{loadingDate}</if>
<if test="foreignType != null and foreignType != ''">, foreign_type = #{foreignType}</if>
<if test="duty != null and duty != ''">, duty = CAST(#{duty} AS NUMERIC)</if>
<if test="exchangeRate != null and exchangeRate != ''">, exchange_rate = CAST(#{exchangeRate} AS NUMERIC)</if>
<if test="importVat != null and importVat != ''">, import_vat = CAST(#{importVat} AS NUMERIC)</if>
WHERE OBJID = #{OBJID}
</update>
<update id="updatePurchaseOrderMasterPriceAll" parameterType="map">
UPDATE PURCHASE_ORDER_MASTER SET
TOTAL_PRICE_TXT_ALL = NUM_TO_KOR((T.REAL_SUPPLY_PRICE_VAT)::varchar,'일금 ',' 원정 (₩ ') || TRIM(TO_CHAR((T.REAL_SUPPLY_PRICE_VAT), '999,999,999,999')) ||')'
@@ -6608,6 +6623,16 @@ FROM(
<!-- 매입마감일 (입고건 단위) -->
,AP.PURCHASE_CLOSE_DATE
<!-- 마감정보 -->
,COALESCE(AP.tax_type, '') AS TAX_TYPE
,COALESCE(AP.tax_invoice_date, '') AS TAX_INVOICE_DATE
,COALESCE(AP.export_decl_no, '') AS EXPORT_DECL_NO
,COALESCE(AP.loading_date, '') AS LOADING_DATE
,COALESCE(AP.foreign_type, '') AS FOREIGN_TYPE
,COALESCE(AP.duty, 0) AS DUTY
,COALESCE(AP.exchange_rate, 0) AS EXCHANGE_RATE
,COALESCE(AP.import_vat, 0) AS IMPORT_VAT
FROM ARRIVAL_PLAN AP
INNER JOIN PURCHASE_ORDER_MASTER POM ON POM.OBJID = AP.PARENT_OBJID
INNER JOIN PURCHASE_ORDER_PART POP ON POP.PURCHASE_ORDER_MASTER_OBJID = POM.OBJID::VARCHAR

View File

@@ -3443,4 +3443,62 @@ public class PurchaseOrderService {
return resultMap;
}
/**
* 입고건별 마감정보 저장
* @param request
* @param paramMap - objIdList, taxType, taxInvoiceDate, exportDeclNo, loadingDate, foreignType, duty, exchangeRate, importVat
* @return 처리 결과
*/
public Map saveArrivalPlanDeadlineInfo(HttpServletRequest request, Map paramMap) {
Map resultMap = new HashMap();
SqlSession sqlSession = null;
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"));
String foreignType = CommonUtils.checkNull(paramMap.get("foreignType"));
String duty = CommonUtils.checkNull(paramMap.get("duty"));
String exchangeRate = CommonUtils.checkNull(paramMap.get("exchangeRate"));
String importVat = CommonUtils.checkNull(paramMap.get("importVat"));
if (objIdListStr == null || objIdListStr.isEmpty()) {
resultMap.put("result", false);
resultMap.put("msg", "선택된 항목이 없습니다.");
return resultMap;
}
String[] targetObjIdList = objIdListStr.split(",");
sqlSession = SqlMapConfig.getInstance().getSqlSession(false);
for (int i = 0; i < targetObjIdList.length; i++) {
HashMap sqlParamMap = new HashMap();
sqlParamMap.put("OBJID", CommonUtils.checkNull(targetObjIdList[i]).trim());
sqlParamMap.put("taxType", taxType);
sqlParamMap.put("taxInvoiceDate", taxInvoiceDate);
sqlParamMap.put("exportDeclNo", exportDeclNo);
sqlParamMap.put("loadingDate", loadingDate);
sqlParamMap.put("foreignType", foreignType);
sqlParamMap.put("duty", duty);
sqlParamMap.put("exchangeRate", exchangeRate);
sqlParamMap.put("importVat", importVat);
sqlSession.update("purchaseOrder.saveArrivalPlanDeadlineInfo", sqlParamMap);
}
sqlSession.commit();
resultMap.put("result", true);
resultMap.put("msg", targetObjIdList.length + "건의 마감정보가 저장되었습니다.");
} catch (Exception e) {
resultMap.put("result", false);
resultMap.put("msg", "마감정보 저장 중 오류가 발생했습니다.");
if (sqlSession != null) sqlSession.rollback();
e.printStackTrace();
} finally {
if (sqlSession != null) sqlSession.close();
}
return resultMap;
}
}