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")); // 거래처명