代码优化
This commit is contained in:
parent
ea0cd475d4
commit
df2f2a3974
|
|
@ -284,11 +284,11 @@ public class SyncOrganizationPersonInfo implements EsbServerlessRpcRemoteInterfa
|
|||
if("delete_type".equalsIgnoreCase(key)||"IS_DELETE".equalsIgnoreCase(key)){
|
||||
userInfo_new.put(key,"0");
|
||||
}
|
||||
// else if(key.equalsIgnoreCase("native_place")){
|
||||
// //籍贯字段处理
|
||||
// log.error("SyncOrganizationPersonInfo.native_place:{}", key);
|
||||
// userInfo_new.put(key,getNativePlaceName(getIgnoreCase(employee_info, key)));
|
||||
// }
|
||||
else if(key.equalsIgnoreCase("native_place")){
|
||||
//籍贯字段处理
|
||||
log.error("SyncOrganizationPersonInfo.native_place:{}", key);
|
||||
userInfo_new.put(key,getNativePlaceName(getIgnoreCase(employee_info, key)));
|
||||
}
|
||||
else{
|
||||
if(getIgnoreCase(employee_info, key)!=null){
|
||||
userInfo_new.put(key,getIgnoreCase(employee_info, key));
|
||||
|
|
@ -407,6 +407,12 @@ public class SyncOrganizationPersonInfo implements EsbServerlessRpcRemoteInterfa
|
|||
log.error("SyncOrganizationPersonInfo3333.employee_new:{}", employee_new);
|
||||
//更新employee表数据
|
||||
code = update("eteams.employee", employee_new, "id", glzzyg);
|
||||
/**
|
||||
* 0811增加系统头像表入值
|
||||
*
|
||||
*/
|
||||
updateAvatarInfo(getIgnoreCase(employee_new, "AVATAR"),glzzyg,tenant_key);
|
||||
|
||||
// 遍历并移除(不包含则移除掉)
|
||||
Map<String, Object> employeeCustomize_new = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
|
||||
for (String key : listOfEmployeeCustomizeColumns) {
|
||||
|
|
@ -442,11 +448,11 @@ public class SyncOrganizationPersonInfo implements EsbServerlessRpcRemoteInterfa
|
|||
if("delete_type".equalsIgnoreCase(key)||"IS_DELETE".equalsIgnoreCase(key)){
|
||||
userInfo_new.put(key,"0");
|
||||
}
|
||||
// else if(key.equalsIgnoreCase("native_place")){
|
||||
// //籍贯字段处理
|
||||
// log.error("SyncOrganizationPersonInfo.native_place2222:{}", key);
|
||||
// userInfo_new.put(key,getNativePlaceName(getIgnoreCase(employee_info, key)));
|
||||
// }
|
||||
else if(key.equalsIgnoreCase("native_place")){
|
||||
//籍贯字段处理
|
||||
log.error("SyncOrganizationPersonInfo.native_place2222:{}", key);
|
||||
userInfo_new.put(key,getNativePlaceName(getIgnoreCase(employee_info, key)));
|
||||
}
|
||||
else{
|
||||
if(getIgnoreCase(employee_info, key)!=null){
|
||||
userInfo_new.put(key,getIgnoreCase(employee_info, key));
|
||||
|
|
@ -535,6 +541,38 @@ public class SyncOrganizationPersonInfo implements EsbServerlessRpcRemoteInterfa
|
|||
log.error("insertAvatarInfo.recordList:{}", recordList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新人员头像信息表
|
||||
* @return
|
||||
*/
|
||||
public void updateAvatarInfo(String avatar,String glzzyg,String tenant_key){
|
||||
log.error("updateAvatarInfo.avatar:{}", avatar);
|
||||
if(StringUtils.isNotBlank(avatar)){
|
||||
//1.avatar不为空,判断avatar是否有值
|
||||
String sql = "select id from eteams.avatar where id '"+avatar+"' and TENANT_KEY = '"+tenant_key+"' ";
|
||||
log.error("updateAvatarInfo.sql111:{}", sql);
|
||||
Map<String, Object> rs = databaseUtils.execute("LOGIC", "weaver-ebuilder-form-service", sql);
|
||||
List<Map<String, Object>> recordList = databaseUtils.getDataSourceList(rs);
|
||||
if(CollectionUtils.isEmpty(recordList)){
|
||||
//为空则插入头像
|
||||
sql="insert into eteams.avatar(ID, P1, P2, P3, P4, P5, TENANT_KEY)" +
|
||||
" values('" + avatar + "','" + avatar + "','" + avatar + "','" + avatar + "','" + avatar + "','" + avatar + "'," +
|
||||
" '" + tenant_key + "')";
|
||||
log.error("updateAvatarInfo.sql222:{}", sql);
|
||||
Map<String, Object> rt = databaseUtils.execute("LOGIC", "weaver-ebuilder-form-service", sql);
|
||||
List<Map<String, Object>> records = databaseUtils.getDataSourceList(rt);
|
||||
log.error("updateAvatarInfo.records:{}", records);
|
||||
}
|
||||
}else {
|
||||
//avatar为空则执行删除操作
|
||||
String sql = "update eteams.employee set avatar = null where id = '"+glzzyg+"' and TENANT_KEY = '"+tenant_key+"' ";
|
||||
log.error("updateAvatarInfo.sql333:{}", sql);
|
||||
Map<String, Object> rt = databaseUtils.execute("LOGIC", "weaver-ebuilder-form-service", sql);
|
||||
List<Map<String, Object>> records = databaseUtils.getDataSourceList(rt);
|
||||
log.error("updateAvatarInfo.records:{}", records);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 写入表单引擎数据大表
|
||||
|
|
|
|||
|
|
@ -428,6 +428,12 @@ public class SyncOrganizationPersonInfo_cbd implements EsbServerlessRpcRemoteInt
|
|||
//更新employee表数据
|
||||
code = update("eteams.employee", employee_new, "id", glzzyg);
|
||||
|
||||
/**
|
||||
* 0811增加系统头像表入值
|
||||
*
|
||||
*/
|
||||
updateAvatarInfo(getIgnoreCase(employee_new, "AVATAR"),glzzyg,tenant_key);
|
||||
|
||||
/**
|
||||
* 写入虚线上级(其他上级)
|
||||
*/
|
||||
|
|
@ -563,6 +569,39 @@ public class SyncOrganizationPersonInfo_cbd implements EsbServerlessRpcRemoteInt
|
|||
log.error("insertAvatarInfo.recordList:{}", recordList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新人员头像信息表
|
||||
* @return
|
||||
*/
|
||||
public void updateAvatarInfo(String avatar,String glzzyg,String tenant_key){
|
||||
log.error("updateAvatarInfo.avatar:{}", avatar);
|
||||
if(StringUtils.isNotBlank(avatar)){
|
||||
//1.avatar不为空,判断avatar是否有值
|
||||
String sql = "select id from eteams.avatar where id '"+avatar+"' and TENANT_KEY = '"+tenant_key+"' ";
|
||||
log.error("updateAvatarInfo.sql111:{}", sql);
|
||||
Map<String, Object> rs = databaseUtils.execute("LOGIC", "weaver-ebuilder-form-service", sql);
|
||||
List<Map<String, Object>> recordList = databaseUtils.getDataSourceList(rs);
|
||||
if(CollectionUtils.isEmpty(recordList)){
|
||||
//为空则插入头像
|
||||
sql="insert into eteams.avatar(ID, P1, P2, P3, P4, P5, TENANT_KEY)" +
|
||||
" values('" + avatar + "','" + avatar + "','" + avatar + "','" + avatar + "','" + avatar + "','" + avatar + "'," +
|
||||
" '" + tenant_key + "')";
|
||||
log.error("updateAvatarInfo.sql222:{}", sql);
|
||||
Map<String, Object> rt = databaseUtils.execute("LOGIC", "weaver-ebuilder-form-service", sql);
|
||||
List<Map<String, Object>> records = databaseUtils.getDataSourceList(rt);
|
||||
log.error("updateAvatarInfo.records:{}", records);
|
||||
}
|
||||
}else {
|
||||
//avatar为空则执行删除操作
|
||||
String sql = "update eteams.employee set avatar = null where id = '"+glzzyg+"' and TENANT_KEY = '"+tenant_key+"' ";
|
||||
log.error("updateAvatarInfo.sql333:{}", sql);
|
||||
Map<String, Object> rt = databaseUtils.execute("LOGIC", "weaver-ebuilder-form-service", sql);
|
||||
List<Map<String, Object>> records = databaseUtils.getDataSourceList(rt);
|
||||
log.error("updateAvatarInfo.records:{}", records);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 写入表单引擎数据大表
|
||||
|
|
|
|||
Loading…
Reference in New Issue