diff --git a/jcl-hrmorganization/secondev-jcl-hrmorganization/src/main/java/com/weaver/seconddev/jcl/organization/esb/SyncOrganizationPersonInfo.java b/jcl-hrmorganization/secondev-jcl-hrmorganization/src/main/java/com/weaver/seconddev/jcl/organization/esb/SyncOrganizationPersonInfo.java index ebc194a..84e9af9 100644 --- a/jcl-hrmorganization/secondev-jcl-hrmorganization/src/main/java/com/weaver/seconddev/jcl/organization/esb/SyncOrganizationPersonInfo.java +++ b/jcl-hrmorganization/secondev-jcl-hrmorganization/src/main/java/com/weaver/seconddev/jcl/organization/esb/SyncOrganizationPersonInfo.java @@ -219,7 +219,7 @@ public class SyncOrganizationPersonInfo implements EsbServerlessRpcRemoteInterfa userInfo_new.put("USER", getIgnoreCase(employee_info, "id")); userInfo_new.put("FORM_DATA",getIgnoreCase(employee_info, "id")); //学位字段 - userInfo_new.put("DEGREE",containsKeyIgnoreCase(employee_info,"degreename")?getIgnoreCase(employee_info, "degreename"):null); + //userInfo_new.put("DEGREE",containsKeyIgnoreCase(employee_info,"degreename")?getIgnoreCase(employee_info, "degreename"):null); userInfo_new.put("CREATE_TIME",nowData); userInfo_new.put("update_time",nowData); //插入 @@ -582,16 +582,9 @@ public class SyncOrganizationPersonInfo implements EsbServerlessRpcRemoteInterfa */ public void updateAllYgxxDetailInfo(String ygxxid){ log.error("updateAllYgxxDetailInfo.ygxxid:{}", ygxxid); - //先查询表明有记录 - String str = "select * from hr_employment_record where USER_ID = '" + ygxxid + "' "; - List> strInfo = getYgxxDetailInfo(str); - log.error("getYgxxDetailInfo.strInfo:{}", strInfo); //先删除原来记录(只能逻辑删除,更新时间也必须加上) - String sql = "update hr_employment_record set delete_type = 1,update_time =? where USER_ID = ? "; - List paramList = new ArrayList<>(); - paramList.add(nowData); - paramList.add(ygxxid); - deleteDetailData(sql,paramList); + String sql = "update hr_employment_record set delete_type = 1,update_time ='" + nowData + "' where USER_ID = "+ygxxid ; + deleteDetailData(sql); /** * 工作履历表 * */ @@ -626,23 +619,16 @@ public class SyncOrganizationPersonInfo implements EsbServerlessRpcRemoteInterfa /** * 教育经历表 * */ - //先查询表明有记录 - str = "select * from hr_education where employee_id = '" + ygxxid + "' "; - List> str2Info = getYgxxDetailInfo(str); - log.error("getYgxxDetailInfo.str2Info:{}", str2Info); //先删除原来记录 - sql = "update hr_education set delete_type = 1,update_time =? where employee_id = ? "; - paramList = new ArrayList<>(); - paramList.add(nowData); - paramList.add(ygxxid); - deleteDetailData(sql,paramList); + sql = "update hr_education set delete_type = 1,update_time ='" + nowData + "' where employee_id = "+ygxxid; + deleteDetailData(sql); String jysql = "select * from uf_jcl_emp_jyjl where FORM_DATA_ID = '" + ygxxid + "' and delete_type=0"; List> jyjlInfo = getYgxxDetailInfo(jysql); List> jyjlColumns = getTableColumnsOfTableName("hr_education"); List listOfjyjlColumns = jyjlColumns.stream() .map(map -> map.get("column_name").toString()) .collect(Collectors.toList()); - log.error("getYgxxDetailInfo.jyjlInfo:{}", jyjlInfo); + log.error("getYgxxDetailInfo.jyjlInfo0172:{}", jyjlInfo); log.error("getYgxxDetailInfo.listOfjyjlColumns:{}", listOfjyjlColumns); for (Map map : jyjlInfo) { Map jyjlInfo_new = new HashMap<>(); @@ -668,11 +654,8 @@ public class SyncOrganizationPersonInfo implements EsbServerlessRpcRemoteInterfa * 家庭信息表 * */ //先删除原来记录 - sql = "update hr_family set delete_type = 1,update_time =? where employee_id = ? "; - paramList = new ArrayList<>(); - paramList.add(nowData); - paramList.add(ygxxid); - deleteDetailData(sql,paramList); + sql = "update hr_family set delete_type = 1,update_time ='" + nowData + "' where employee_id = "+ygxxid; + deleteDetailData(sql); String jtxxsql = "select * from uf_jcl_emp_jtxx where FORM_DATA_ID = '" + ygxxid + "' and delete_type=0"; List> jtxxInfo = getYgxxDetailInfo(jtxxsql); List> jtxxColumns = getTableColumnsOfTableName("hr_family"); @@ -705,11 +688,8 @@ public class SyncOrganizationPersonInfo implements EsbServerlessRpcRemoteInterfa * 表彰与奖励 * */ //先删除原来记录 - sql = "update hr_rewards_before set delete_type = 1,update_time =? where Employeeid = ? "; - paramList = new ArrayList<>(); - paramList.add(nowData); - paramList.add(ygxxid); - deleteDetailData(sql,paramList); + sql = "update hr_rewards_before set delete_type = 1,update_time ='" + nowData + "' where Employeeid = "+ygxxid; + deleteDetailData(sql); String bzsql = "select * from uf_jcl_emp_bzyjl where FORM_DATA_ID = '" + ygxxid + "' and delete_type=0"; List> bzInfo = getYgxxDetailInfo(bzsql); List> bzColumns = getTableColumnsOfTableName("hr_rewards_before"); @@ -742,11 +722,8 @@ public class SyncOrganizationPersonInfo implements EsbServerlessRpcRemoteInterfa * 培训经历 * */ //先删除原来记录 - sql = "update hr_train set delete_type = 1,update_time =? where employee_id = ? "; - paramList = new ArrayList<>(); - paramList.add(nowData); - paramList.add(ygxxid); - deleteDetailData(sql,paramList); + sql = "update hr_train set delete_type = 1,update_time ='" + nowData + "' where employee_id = "+ygxxid; + deleteDetailData(sql); String pxsql = "select * from uf_jcl_emp_pxjl where FORM_DATA_ID = '" + ygxxid + "' and delete_type=0"; List> pxInfo = getYgxxDetailInfo(pxsql); List> pxColumns = getTableColumnsOfTableName("hr_train"); @@ -779,11 +756,8 @@ public class SyncOrganizationPersonInfo implements EsbServerlessRpcRemoteInterfa * 语言能力 * */ //先删除原来记录 - sql = "update hr_language set delete_type = 1,update_time =? where employee_id = ? "; - paramList = new ArrayList<>(); - paramList.add(nowData); - paramList.add(ygxxid); - deleteDetailData(sql,paramList); + sql = "update hr_language set delete_type = 1,update_time ='" + nowData + "' where employee_id = "+ygxxid; + deleteDetailData(sql); String yysql = "select * from uf_jcl_emp_yynl where FORM_DATA_ID = '" + ygxxid + "' and delete_type=0"; List> yyInfo = getYgxxDetailInfo(yysql); List> yyColumns = getTableColumnsOfTableName("hr_language"); @@ -816,11 +790,8 @@ public class SyncOrganizationPersonInfo implements EsbServerlessRpcRemoteInterfa * 权威机构资格 * */ //先删除原来记录 - sql = "update hr_certification set delete_type = 1,update_time =? where employee_id = ? "; - paramList = new ArrayList<>(); - paramList.add(nowData); - paramList.add(ygxxid); - deleteDetailData(sql,paramList); + sql = "update hr_certification set delete_type = 1,update_time ='" + nowData + "' where employee_id = "+ygxxid; + deleteDetailData(sql); String qwsql = "select * from uf_jcl_emp_qwjgzgrz where FORM_DATA_ID = '" + ygxxid + "' and delete_type=0"; List> qwInfo = getYgxxDetailInfo(qwsql); List> qwColumns = getTableColumnsOfTableName("hr_certification"); @@ -1073,8 +1044,8 @@ public class SyncOrganizationPersonInfo implements EsbServerlessRpcRemoteInterfa * 删除系统明细表数据 * @return */ - public void deleteDetailData(String sql,List paramList){ - log.error("deleteDetailData.sql:{},paramList:{}", sql, paramList); + public void deleteDetailData(String sql){ + log.error("deleteDetailData888.sql:{}", sql); Map rs = databaseUtils.execute("LOGIC", "weaver-ebuilder-form-service", sql); List> recordList = databaseUtils.getDataSourceList(rs); log.error("deleteDetailData.recordList:{}", recordList); diff --git a/jcl-hrmorganization/secondev-jcl-hrmorganization/src/main/java/com/weaver/seconddev/jcl/organization/util/DatabaseUtils.java b/jcl-hrmorganization/secondev-jcl-hrmorganization/src/main/java/com/weaver/seconddev/jcl/organization/util/DatabaseUtils.java index f2ef6b4..8990ac8 100644 --- a/jcl-hrmorganization/secondev-jcl-hrmorganization/src/main/java/com/weaver/seconddev/jcl/organization/util/DatabaseUtils.java +++ b/jcl-hrmorganization/secondev-jcl-hrmorganization/src/main/java/com/weaver/seconddev/jcl/organization/util/DatabaseUtils.java @@ -111,7 +111,10 @@ public class DatabaseUtils { */ public List> getDataSourceList(Map map) { List> entity = new ArrayList(); - if ("OK".equals(com.weaver.seconddev.jcl.organization.util.CommonUtils.null2String(map.get("status")).toUpperCase(Locale.ROOT)) && map.get("count") != null && CommonUtils.getIntValue(map.get("count")) > 0) { + if ("OK".equals(com.weaver.seconddev.jcl.organization.util.CommonUtils.null2String(map.get("status")).toUpperCase(Locale.ROOT)) + && map.get("count") != null + && CommonUtils.getIntValue(map.get("count")) > 0 + && map.get("records") != null) { entity = (List) map.get("records"); }