diff --git a/WebContent/WEB-INF/classes/com/pms/mapper/mybatisConf.xml b/WebContent/WEB-INF/classes/com/pms/mapper/mybatisConf.xml index 66dfcab..d717bfb 100644 --- a/WebContent/WEB-INF/classes/com/pms/mapper/mybatisConf.xml +++ b/WebContent/WEB-INF/classes/com/pms/mapper/mybatisConf.xml @@ -89,10 +89,11 @@ - - - - - - + + + + + + + \ No newline at end of file diff --git a/WebContent/WEB-INF/view/admin/clientMng/clientMngList.jsp b/WebContent/WEB-INF/view/admin/clientMng/clientMngList.jsp index b351099..3a7059f 100644 --- a/WebContent/WEB-INF/view/admin/clientMng/clientMngList.jsp +++ b/WebContent/WEB-INF/view/admin/clientMng/clientMngList.jsp @@ -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: '배치 실행 중 오류가 발생했습니다.' + }); + } + }); + } +} @@ -267,8 +318,9 @@ function openclientMngListInfoPopUp(objid){
- + +
diff --git a/WebContent/WEB-INF/view/admin/dept/deptList.jsp b/WebContent/WEB-INF/view/admin/dept/deptList.jsp index 748aa04..2f16b48 100644 --- a/WebContent/WEB-INF/view/admin/dept/deptList.jsp +++ b/WebContent/WEB-INF/view/admin/dept/deptList.jsp @@ -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: '배치 실행 중 오류가 발생했습니다.' + }); + } + }); + } +} + @@ -176,7 +227,8 @@ function fn_deleteGroup(DEPT_CODE){
- + +
diff --git a/WebContent/WEB-INF/view/admin/user/userList.jsp b/WebContent/WEB-INF/view/admin/user/userList.jsp index 021ad0e..3d9da4b 100644 --- a/WebContent/WEB-INF/view/admin/user/userList.jsp +++ b/WebContent/WEB-INF/view/admin/user/userList.jsp @@ -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){
- + +
diff --git a/src/com/pms/mapper/batch.xml b/src/com/pms/mapper/batch.xml index d99f6ee..e066a5f 100644 --- a/src/com/pms/mapper/batch.xml +++ b/src/com/pms/mapper/batch.xml @@ -6,7 +6,7 @@ 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 diff --git a/src/com/pms/service/BatchService.java b/src/com/pms/service/BatchService.java index df71139..86fe072 100644 --- a/src/com/pms/service/BatchService.java +++ b/src/com/pms/service/BatchService.java @@ -508,9 +508,6 @@ public class BatchService extends BaseService { private Map parseCustomerObject(String json) { Map customer = new HashMap(); - // objid는 자동생성 - customer.put("objid", CommonUtils.createObjId()); - // 기본 정보 customer.put("client_cd", extractJsonValue(json, "trCd")); // 거래처코드 customer.put("client_nm", extractJsonValue(json, "trNm")); // 거래처명