배치 서비스 등록록

This commit is contained in:
2026-02-05 10:39:15 +09:00
parent 867aa398a3
commit 8aa93a2cc2
6 changed files with 174 additions and 16 deletions

View File

@@ -89,10 +89,11 @@
<mapper resource="/com/pms/ions/itemmgmt/mapper/materialWarehousing.xml" />
<mapper resource="/com/pms/ions/itemmgmt/mapper/standardComponent.xml" />
<mapper resource="/com/pms/ions/itemmgmt/mapper/bom.xml" />
<mapper resource="/com/pms/ions/productioninventory/mapper/ProductionInventory.xml" />
<mapper resource="/com/pms/ions/productioninventory/mapper/RequiredAmount.xml" />
<mapper resource="/com/pms/ions/productioninventory/mapper/Magam.xml" />
<mapper resource="/com/pms/ions/productioninventory/mapper/ExcelRegInven.xml" />
</mappers>
<mapper resource="/com/pms/ions/productioninventory/mapper/ProductionInventory.xml" />
<mapper resource="/com/pms/ions/productioninventory/mapper/RequiredAmount.xml" />
<mapper resource="/com/pms/ions/productioninventory/mapper/Magam.xml" />
<mapper resource="/com/pms/ions/productioninventory/mapper/ExcelRegInven.xml" />
<mapper resource="/com/pms/mapper/batch.xml" />
</mappers>
</configuration>

View File

@@ -34,6 +34,11 @@
fn_delete();
});
//ERP 거래처 동기화
$("#btnSyncErp").click(function(){
fn_syncErp();
});
fn_search();
});
@@ -251,6 +256,52 @@ function openclientMngListInfoPopUp(objid){
hiddenForm.action = "/admin/clientMngListFormPopUp.do";
hiddenForm.submit();
}
function fn_syncErp(){
if(confirm("ERP 시스템의 거래처 정보를 동기화하시겠습니까?")){
// 로딩 표시
Swal.fire({
title: '동기화 중...',
text: 'ERP 거래처 데이터를 가져오는 중입니다. 잠시만 기다려주세요.',
allowOutsideClick: false,
didOpen: () => {
Swal.showLoading();
}
});
$.ajax({
type : "POST",
url : "/admin/syncCustomerDataManual.do",
dataType:"json",
success:function(data){
Swal.close();
if(data.success){
Swal.fire({
icon: 'success',
title: '동기화 완료',
text: data.message
}).then(function(){
fn_search(); // 목록 새로고침
});
} else {
Swal.fire({
icon: 'error',
title: '동기화 실패',
text: data.message
});
}
},
error: function(jqxhr, status, error){
Swal.close();
Swal.fire({
icon: 'error',
title: '오류 발생',
text: '배치 실행 중 오류가 발생했습니다.'
});
}
});
}
}
</script>
</head>
<body style="overflow-y: hidden;">
@@ -267,8 +318,9 @@ function openclientMngListInfoPopUp(objid){
</h2>
<div class="btnArea">
<input type="button" value="조회" class="plm_btns" id="btnSearch">
<input type="button" value="일반거래처등록" class="plm_btns" onclick="javascript:openclientMngListInfoPopUp('');">
<!-- <input type="button" value="일반거래처등록" class="plm_btns" onclick="javascript:openclientMngListInfoPopUp('');"> -->
<input type="button" value="삭제" class="plm_btns" id="btnDelete">
<input type="button" value="ERP 거래처 동기화" class="plm_btns" id="btnSyncErp" style="background-color:#4CAF50;color:white;">
<!-- <input type="button" value="Excel Upload" class="plm_btns" onclick="saveexcelpop();"> -->
</div>
</div>

View File

@@ -68,6 +68,11 @@ $(function(){
document.form1.page.value = "1";
fn_search();
});
//ERP 부서 동기화
$("#btnSyncErp").click(function(){
fn_syncErp();
});
});
//조회 기능
function fn_search(){
@@ -153,6 +158,52 @@ function fn_deleteGroup(DEPT_CODE){
}
}
function fn_syncErp(){
if(confirm("ERP 시스템의 부서 정보를 동기화하시겠습니까?")){
// 로딩 표시
Swal.fire({
title: '동기화 중...',
text: 'ERP 부서 데이터를 가져오는 중입니다. 잠시만 기다려주세요.',
allowOutsideClick: false,
didOpen: () => {
Swal.showLoading();
}
});
$.ajax({
type : "POST",
url : "/admin/syncDepartmentDataManual.do",
dataType:"json",
success:function(data){
Swal.close();
if(data.success){
Swal.fire({
icon: 'success',
title: '동기화 완료',
text: data.message
}).then(function(){
fn_search(); // 목록 새로고침
});
} else {
Swal.fire({
icon: 'error',
title: '동기화 실패',
text: data.message
});
}
},
error: function(jqxhr, status, error){
Swal.close();
Swal.fire({
icon: 'error',
title: '오류 발생',
text: '배치 실행 중 오류가 발생했습니다.'
});
}
});
}
}
</script>
</head>
<body>
@@ -176,7 +227,8 @@ function fn_deleteGroup(DEPT_CODE){
</div>
<div id="adminBtnWrap">
<input type="button" value="조회" class="btns" id="btnSearch">
<input type="button" value="부서 등록" class="btns" id="btnRegist">
<!-- <input type="button" value="부서 등록" class="btns" id="btnRegist"> -->
<input type="button" value="ERP 부서 동기화" class="btns" id="btnSyncErp" style="background-color:#4CAF50;color:white;">
</div>
<div id="adminTableWrap">
<div id="tableWrap">

View File

@@ -70,8 +70,59 @@ $(function(){
fn_delete();
});
//ERP 사용자 동기화
$("#btnSyncErp").click(function(){
fn_syncErp();
});
});
function fn_syncErp(){
if(confirm("ERP 시스템의 사원 정보를 동기화하시겠습니까?")){
// 로딩 표시
Swal.fire({
title: '동기화 중...',
text: 'ERP 사원 데이터를 가져오는 중입니다. 잠시만 기다려주세요.',
allowOutsideClick: false,
didOpen: () => {
Swal.showLoading();
}
});
$.ajax({
type : "POST",
url : "/admin/syncEmployeeDataManual.do",
dataType:"json",
success:function(data){
Swal.close();
if(data.success){
Swal.fire({
icon: 'success',
title: '동기화 완료',
text: data.message
}).then(function(){
fn_search(); // 목록 새로고침
});
} else {
Swal.fire({
icon: 'error',
title: '동기화 실패',
text: data.message
});
}
},
error: function(jqxhr, status, error){
Swal.close();
Swal.fire({
icon: 'error',
title: '오류 발생',
text: '배치 실행 중 오류가 발생했습니다.'
});
}
});
}
}
function fn_delete(){
if(0 < $("input[name=IdCheck]:checked").length){
if(confirm("선택한 사용자 정보를 삭제하시겠습니까?")){
@@ -174,8 +225,9 @@ function fn_openUserHistory(userId){
</div>
<div id="adminBtnWrap">
<input type="button" value="조회" class="btns" id="btnSearch">
<input type="button" value="사용자 등록" class="btns" id="btnRegist">
<!-- <input type="button" value="사용자 등록" class="btns" id="btnRegist"> -->
<input type="button" value="삭제" class="btns" id="btnDelete">
<input type="button" value="ERP 사용자 동기화" class="btns" id="btnSyncErp" style="background-color:#4CAF50;color:white;">
</div>
<div id="adminTableWrap">
<div id="tableWrap">

View File

@@ -6,7 +6,7 @@
<!-- 거래처 정보 UPSERT (실제 테이블 컬럼 기준) -->
<insert id="upsertCustomer" parameterType="map">
INSERT INTO client_mng (
objid, client_cd, client_nm, tr_nmk, client_nmk, attr_nmk, client_type,
client_cd, client_nm, tr_nmk, client_nmk, attr_nmk, client_type,
bus_reg_no, resident_no, ceo_nm, ceo_nmk, bus_type, bus_item,
post_no, addr1, addr2, tel_no, fax_no, homepage, email,
liq_rs, tr_fg, country_nm, class_cd, class_nm, grade_cd, grade_nm,
@@ -26,9 +26,9 @@
project_cd, project_nm, pjt_nmk, ext_data_cd, e_tax_yn,
unit_report_client, sub_bus_no, procurement_yn, use_fg, for_yn,
plan_day_type, plan_day, purpose_type,
insert_id, insert_dt, modify_id, modify_dt
insert_id, insert_dt,objid
) VALUES (
#{objid}::numeric, #{client_cd}, #{client_nm}, #{tr_nmk}, #{client_nmk}, #{attr_nmk}, #{client_type},
#{client_cd}, #{client_nm}, #{tr_nmk}, #{client_nmk}, #{attr_nmk}, #{client_type},
#{bus_reg_no}, #{resident_no}, #{ceo_nm}, #{ceo_nmk}, #{bus_type}, #{bus_item},
#{post_no}, #{addr1}, #{addr2}, #{tel_no}, #{fax_no}, #{homepage}, #{email},
#{liq_rs}, #{tr_fg}, #{country_nm}, #{class_cd}, #{class_nm}, #{grade_cd}, #{grade_nm},
@@ -48,7 +48,7 @@
#{project_cd}, #{project_nm}, #{pjt_nmk}, #{ext_data_cd}, #{e_tax_yn},
#{unit_report_client}, #{sub_bus_no}, #{procurement_yn}, #{use_fg}, #{for_yn},
#{plan_day_type}, #{plan_day}, #{purpose_type},
#{insert_id}, now()
#{insert_id}, now(),#{client_cd}
) ON CONFLICT (client_cd) DO
UPDATE SET
client_nm = #{client_nm}, tr_nmk = #{tr_nmk}, client_nmk = #{client_nmk}, attr_nmk = #{attr_nmk},
@@ -93,6 +93,8 @@
parent_dept_code,
dept_name,
status,
location_name,
company_name,
data_type,
regdate
) VALUES (
@@ -100,6 +102,8 @@
#{parent_dept_code},
#{dept_name},
#{status},
'(주)RPS',
'(주)RPS',
#{data_type},
NOW()
) ON CONFLICT (dept_code) DO

View File

@@ -508,9 +508,6 @@ public class BatchService extends BaseService {
private Map<String, Object> parseCustomerObject(String json) {
Map<String, Object> customer = new HashMap<String, Object>();
// objid는 자동생성
customer.put("objid", CommonUtils.createObjId());
// 기본 정보
customer.put("client_cd", extractJsonValue(json, "trCd")); // 거래처코드
customer.put("client_nm", extractJsonValue(json, "trNm")); // 거래처명