From 6ffa03bb2a50ce2e84a9243502e63141db63c02c Mon Sep 17 00:00:00 2001 From: dxfeng Date: Wed, 28 May 2025 11:23:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8B=9B=E8=81=98=20=E5=B2=97=E4=BD=8D?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/hzzx/entity/Employee.java | 1 + src/com/engine/hzzx/entity/EmployeeTrans.java | 19 ++++++++++++++++--- .../hzzx/cronjob/SyncBeiSenInfoJob.java | 5 +++-- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/com/engine/hzzx/entity/Employee.java b/src/com/engine/hzzx/entity/Employee.java index 2614781..28b1ff3 100644 --- a/src/com/engine/hzzx/entity/Employee.java +++ b/src/com/engine/hzzx/entity/Employee.java @@ -41,6 +41,7 @@ public class Employee { private Integer age; private String departmentCode; private String positionCode; + private String positionName; @Override public String toString() { diff --git a/src/com/engine/hzzx/entity/EmployeeTrans.java b/src/com/engine/hzzx/entity/EmployeeTrans.java index aa21b6d..14732ca 100644 --- a/src/com/engine/hzzx/entity/EmployeeTrans.java +++ b/src/com/engine/hzzx/entity/EmployeeTrans.java @@ -49,13 +49,26 @@ public class EmployeeTrans { } - public static String getJobtitleId(String jobtitleCode) { + //public static String getJobtitleId(String jobtitleCode) { + // String jobtitleId = ""; + // RecordSet rs = new RecordSet(); + // if (StringUtils.isBlank(jobtitleCode)) { + // return jobtitleId; + // } + // rs.executeQuery("select id from hrmjobtitles where jobtitlecode = ?", jobtitleCode); + // if (rs.next()) { + // jobtitleId = rs.getString("id"); + // } + // return jobtitleId; + //} + + public static String getJobIdByName(String name) { String jobtitleId = ""; RecordSet rs = new RecordSet(); - if (StringUtils.isBlank(jobtitleCode)) { + if (StringUtils.isBlank(name)) { return jobtitleId; } - rs.executeQuery("select id from hrmjobtitles where jobtitlecode = ?", jobtitleCode); + rs.executeQuery("select id from uf_gwgl where gwmc = ?", name); if (rs.next()) { jobtitleId = rs.getString("id"); } diff --git a/src/weaver/interfaces/hzzx/cronjob/SyncBeiSenInfoJob.java b/src/weaver/interfaces/hzzx/cronjob/SyncBeiSenInfoJob.java index 3352fc4..55b9333 100644 --- a/src/weaver/interfaces/hzzx/cronjob/SyncBeiSenInfoJob.java +++ b/src/weaver/interfaces/hzzx/cronjob/SyncBeiSenInfoJob.java @@ -136,6 +136,7 @@ public class SyncBeiSenInfoJob extends BaseCronJob { if (null != position) { // 设置岗位编号 employeeObject.setPositionCode(position.getCode()); + employeeObject.setPositionName(position.getName()); } employeeList.add(employeeObject); } @@ -288,7 +289,7 @@ public class SyncBeiSenInfoJob extends BaseCronJob { insertData.put("ypbm", departmentId); } // 职位 - String jobtitleId = EmployeeTrans.getJobtitleId(employee.getPositionCode()); + String jobtitleId = EmployeeTrans.getJobIdByName(employee.getPositionName()); if (StringUtils.isNotBlank(jobtitleId)) { insertData.put("ypgw", jobtitleId); } @@ -346,7 +347,7 @@ public class SyncBeiSenInfoJob extends BaseCronJob { // insertData.put("ypbm", departmentId); //} // 岗位 - String jobtitleId = EmployeeTrans.getJobtitleId(employee.getPositionCode()); + String jobtitleId = EmployeeTrans.getJobIdByName(employee.getPositionName()); if (StringUtils.isNotBlank(jobtitleId)) { insertData.put("gw", jobtitleId); }