优化代码逻辑,去除map表交互,提升人员导入速度
This commit is contained in:
parent
bbf8408bb4
commit
46d8e99088
|
|
@ -19,7 +19,6 @@ import com.engine.organization.mapper.scheme.GradeMapper;
|
|||
import com.engine.organization.mapper.scheme.LevelMapper;
|
||||
import com.engine.organization.mapper.scheme.SchemeMapper;
|
||||
import com.engine.organization.mapper.sequence.SequenceMapper;
|
||||
import com.engine.organization.thread.HrmResourceTriggerRunnable;
|
||||
import com.engine.organization.util.db.MapperProxyFactory;
|
||||
import com.wbi.util.Util;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
|
@ -68,49 +67,51 @@ public class CusFieldDataTrigger {
|
|||
JobPO jobById = MapperProxyFactory.getProxy(JobMapper.class).getJobById(gwId);
|
||||
if (null != jobById) {
|
||||
RecordInfo hrmJobTitleByName = MapperProxyFactory.getProxy(SystemDataMapper.class).getHrmJobTitleByName(jobById.getJobName());
|
||||
Long ecGwId = StringUtils.isNotBlank(hrmJobTitleByName.getId()) ? Long.parseLong(hrmJobTitleByName.getId()) : null;
|
||||
Long ecBmId = jobById.getEcDepartment();
|
||||
Long ecGsId = jobById.getEcCompany();
|
||||
Map<String, Object> hrmResourceMap = new HashMap<>();
|
||||
// 岗位
|
||||
hrmResourceMap.put("jobtitle", ecGwId);
|
||||
// 部门
|
||||
hrmResourceMap.put("departmentid", ecBmId);
|
||||
// 公司
|
||||
hrmResourceMap.put("subcompanyid1", ecGsId);
|
||||
MapperProxyFactory.getProxy(ExtMapper.class).updateTable(ExtendInfoParams.builder().id(id).tableName("hrmresource").params(hrmResourceMap).build());
|
||||
updateFlag = true;
|
||||
if(null!=hrmJobTitleByName) {
|
||||
Long ecGwId = StringUtils.isNotBlank(hrmJobTitleByName.getId()) ? Long.parseLong(hrmJobTitleByName.getId()) : null;
|
||||
Long ecBmId = jobById.getEcDepartment();
|
||||
Long ecGsId = jobById.getEcCompany();
|
||||
Map<String, Object> hrmResourceMap = new HashMap<>();
|
||||
// 岗位
|
||||
hrmResourceMap.put("jobtitle", ecGwId);
|
||||
// 部门
|
||||
hrmResourceMap.put("departmentid", ecBmId);
|
||||
// 公司
|
||||
hrmResourceMap.put("subcompanyid1", ecGsId);
|
||||
MapperProxyFactory.getProxy(ExtMapper.class).updateTable(ExtendInfoParams.builder().id(id).tableName("hrmresource").params(hrmResourceMap).build());
|
||||
updateFlag = true;
|
||||
|
||||
// 职等职级为空,从岗位取值、更新
|
||||
if (StringUtils.isBlank(sourceField100001)) {
|
||||
if (StringUtils.isNotBlank(jobById.getLevelId())) {
|
||||
// 通过岗位关联,如有多个职等,选取第一个
|
||||
String[] levelArray = jobById.getLevelId().split(",");
|
||||
LevelPO levelByID = MapperProxyFactory.getProxy(LevelMapper.class).getLevelByID(Long.parseLong(levelArray[0]));
|
||||
directionData.setField100008(levelByID.getLevelName());
|
||||
} else {
|
||||
directionData.setField100008(null);
|
||||
}
|
||||
// 职等职级方案
|
||||
if (StringUtils.isNotBlank(Util.null2String(jobById.getSchemeId()))) {
|
||||
SchemePO schemeByID = MapperProxyFactory.getProxy(SchemeMapper.class).getSchemeByID(jobById.getSchemeId());
|
||||
directionData.setField100006(schemeByID.getSchemeName());
|
||||
} else {
|
||||
directionData.setField100006(null);
|
||||
}
|
||||
// 职级
|
||||
if (StringUtils.isNotBlank(jobById.getGradeId())) {
|
||||
GradePO gradeByLevelId = MapperProxyFactory.getProxy(GradeMapper.class).getGradeByID(Long.parseLong(jobById.getGradeId()));
|
||||
directionData.setField100007(gradeByLevelId.getGradeName());
|
||||
} else {
|
||||
directionData.setField100007(null);
|
||||
}
|
||||
// 岗位序列
|
||||
if (StringUtils.isNotBlank(Util.null2String(jobById.getSequenceId()))) {
|
||||
SequencePO sequenceBySchemeId = MapperProxyFactory.getProxy(SequenceMapper.class).getSequenceByID(jobById.getSequenceId());
|
||||
directionData.setField100005(sequenceBySchemeId.getSequenceName());
|
||||
} else {
|
||||
directionData.setField100005(null);
|
||||
// 职等职级为空,从岗位取值、更新
|
||||
if (StringUtils.isBlank(sourceField100001)) {
|
||||
if (StringUtils.isNotBlank(jobById.getLevelId())) {
|
||||
// 通过岗位关联,如有多个职等,选取第一个
|
||||
String[] levelArray = jobById.getLevelId().split(",");
|
||||
LevelPO levelByID = MapperProxyFactory.getProxy(LevelMapper.class).getLevelByID(Long.parseLong(levelArray[0]));
|
||||
directionData.setField100008(levelByID.getLevelName());
|
||||
} else {
|
||||
directionData.setField100008(null);
|
||||
}
|
||||
// 职等职级方案
|
||||
if (StringUtils.isNotBlank(Util.null2String(jobById.getSchemeId()))) {
|
||||
SchemePO schemeByID = MapperProxyFactory.getProxy(SchemeMapper.class).getSchemeByID(jobById.getSchemeId());
|
||||
directionData.setField100006(schemeByID.getSchemeName());
|
||||
} else {
|
||||
directionData.setField100006(null);
|
||||
}
|
||||
// 职级
|
||||
if (StringUtils.isNotBlank(jobById.getGradeId())) {
|
||||
GradePO gradeByLevelId = MapperProxyFactory.getProxy(GradeMapper.class).getGradeByID(Long.parseLong(jobById.getGradeId()));
|
||||
directionData.setField100007(gradeByLevelId.getGradeName());
|
||||
} else {
|
||||
directionData.setField100007(null);
|
||||
}
|
||||
// 岗位序列
|
||||
if (StringUtils.isNotBlank(Util.null2String(jobById.getSequenceId()))) {
|
||||
SequencePO sequenceBySchemeId = MapperProxyFactory.getProxy(SequenceMapper.class).getSequenceByID(jobById.getSequenceId());
|
||||
directionData.setField100005(sequenceBySchemeId.getSequenceName());
|
||||
} else {
|
||||
directionData.setField100005(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -164,6 +165,6 @@ public class CusFieldDataTrigger {
|
|||
MapperProxyFactory.getProxy(SystemDataMapper.class).updateCusFieldData(directionData);
|
||||
}
|
||||
// 刷新组织结构图
|
||||
new HrmResourceTriggerRunnable(id).run();
|
||||
// new HrmResourceTriggerRunnable(id).run();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@ import com.engine.organization.entity.jclimport.po.JclImportHistoryDetailPO;
|
|||
import com.engine.organization.mapper.jclimport.JclImportHistoryDetailMapper;
|
||||
import com.engine.organization.mapper.jclimport.JclImportHistoryMapper;
|
||||
import com.engine.organization.mapper.job.JobMapper;
|
||||
import com.engine.organization.thread.HrmResourceTriggerRunnable;
|
||||
import com.engine.organization.trigger.cusfielddata.CusFieldDataTrigger;
|
||||
import com.engine.organization.util.db.MapperProxyFactory;
|
||||
import com.weaver.integration.ldap.sync.oa.OaSync;
|
||||
|
|
@ -824,7 +823,7 @@ public class HrmImportProcessE9 extends BaseBean {
|
|||
|
||||
new HrmDateCheck().calWorkInfo("" + id);
|
||||
// 刷新组织结构图
|
||||
new HrmResourceTriggerRunnable((long) id).run();
|
||||
// new HrmResourceTriggerRunnable((long) id).run();
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1498,7 +1497,7 @@ public class HrmImportProcessE9 extends BaseBean {
|
|||
resultList.add(createLog(vo, "更新", "失败", "系统错误,请联系管理员"));
|
||||
}
|
||||
// 刷新组织结构图
|
||||
new HrmResourceTriggerRunnable((long) keyMap.get(key)).run();
|
||||
// new HrmResourceTriggerRunnable((long) keyMap.get(key)).run();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
//数据异常
|
||||
|
|
|
|||
Loading…
Reference in New Issue