commit
3113ed1984
|
|
@ -0,0 +1,20 @@
|
|||
package com.engine.organization.entity.fieldset.param;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/09/08
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class FieldTransferParam {
|
||||
private String id;
|
||||
private String name;
|
||||
}
|
||||
|
|
@ -437,7 +437,7 @@
|
|||
select
|
||||
<include refid="baseColumns"/>
|
||||
from jcl_field_extendinfo t
|
||||
where t.delete_type = 0 and t.isenable = 1 and t.extend_type = #{extendType}
|
||||
where t.delete_type = 0 and list_show = 1 and t.isenable = 1 and t.extend_type = #{extendType}
|
||||
and t.field_name_desc = #{labelName}
|
||||
</select>
|
||||
|
||||
|
|
|
|||
|
|
@ -43,6 +43,8 @@ public interface SystemDataMapper {
|
|||
|
||||
List<Long> getHrmResourceIds(@Param("departmentId") Long departmentId, @Param("jobTitle") String jobTitle);
|
||||
|
||||
List<Long> getHrmResourceIdsByDept(@Param("departmentId") String departmentId);
|
||||
|
||||
/**
|
||||
* 更新人员岗位
|
||||
*
|
||||
|
|
|
|||
|
|
@ -181,6 +181,11 @@
|
|||
select max(id)
|
||||
from hrmresource
|
||||
</select>
|
||||
<select id="getHrmResourceIdsByDept" resultType="java.lang.Long">
|
||||
select id
|
||||
from hrmresource
|
||||
where departmentid = #{departmentId}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
@ -206,6 +206,8 @@ public class CompServiceImpl extends Service implements CompService {
|
|||
String ecCompany = Util.null2String(params.get("ec_company"));
|
||||
if (StringUtils.isNotBlank(ecCompany)) {
|
||||
params.put("parent_company", EcHrmRelationUtil.getJclCompanyId(ecCompany).getId());
|
||||
}else{
|
||||
params.put("parent_company", "");
|
||||
}
|
||||
new OrganizationSyncEc(user, LogModuleNameEnum.COMPANY, OperateTypeEnum.UPDATE, params).sync();
|
||||
// 更新主表数据
|
||||
|
|
@ -371,6 +373,8 @@ public class CompServiceImpl extends Service implements CompService {
|
|||
CompPO jclCompanyId = EcHrmRelationUtil.getJclCompanyId(targetCompanyId + "");
|
||||
if (null != jclCompanyId) {
|
||||
compPO.setParentCompany(jclCompanyId.getId());
|
||||
} else {
|
||||
compPO.setParentCompany(null);
|
||||
}
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("id", compPO.getId());
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import com.engine.common.util.ServiceUtil;
|
|||
import com.engine.core.impl.Service;
|
||||
import com.engine.hrm.entity.RuleCodeType;
|
||||
import com.engine.organization.component.OrganizationWeaTable;
|
||||
import com.engine.organization.entity.DeleteParam;
|
||||
import com.engine.organization.entity.codesetting.po.CodeRulePO;
|
||||
import com.engine.organization.entity.commom.RecordInfo;
|
||||
import com.engine.organization.entity.company.bo.CompBO;
|
||||
|
|
@ -38,6 +39,7 @@ import com.engine.organization.mapper.job.JobMapper;
|
|||
import com.engine.organization.service.DepartmentService;
|
||||
import com.engine.organization.service.ExtService;
|
||||
import com.engine.organization.thread.DepartmentTriggerRunnable;
|
||||
import com.engine.organization.thread.HrmResourceTriggerRunnable;
|
||||
import com.engine.organization.thread.JobTriggerRunnable;
|
||||
import com.engine.organization.thread.OrganizationSyncEc;
|
||||
import com.engine.organization.util.*;
|
||||
|
|
@ -50,6 +52,7 @@ import com.engine.organization.util.relation.EcHrmRelationUtil;
|
|||
import com.engine.organization.util.tree.SearchTreeUtil;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.general.StringUtil;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.User;
|
||||
|
|
@ -293,6 +296,8 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
params.put("ec_company", EcHrmRelationUtil.getEcCompanyId(jclDepartmentId.getParentComp() + ""));
|
||||
}
|
||||
|
||||
} else {
|
||||
params.put("parent_dept", "");
|
||||
}
|
||||
new OrganizationSyncEc(user, LogModuleNameEnum.DEPARTMENT, OperateTypeEnum.UPDATE, params).sync();
|
||||
// 更新主表数据
|
||||
|
|
@ -307,7 +312,8 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
// 刷新岗位所属分部
|
||||
refreshJobComp(searchParam.getId(), parentComp);
|
||||
List<DepartmentPO> childList = getDepartmentMapper().getDeptListByPId(searchParam.getId());
|
||||
forbiddenChildTag(parentComp, childList, false);
|
||||
String ecCompanyId = EcHrmRelationUtil.getEcCompanyId(Util.null2String(parentComp));
|
||||
forbiddenChildTag(parentComp, ecCompanyId, childList);
|
||||
|
||||
return searchParam.getId();
|
||||
}
|
||||
|
|
@ -549,19 +555,20 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
|
||||
@Override
|
||||
public int mergeDepartment(DepartmentMergeParam mergeParam) {
|
||||
//TODO 逻辑重写,被合并部门,子元素全部转移。被合并部门删除、封存
|
||||
HasRightUtil.hasRight(user, RIGHT_NAME, false);
|
||||
int updateCount;
|
||||
// 被合并部门
|
||||
Long ecParamDepartment = mergeParam.getDepartment();
|
||||
DepartmentPO jclDepartmentId = EcHrmRelationUtil.getJclDepartmentId(ecParamDepartment + "");
|
||||
Long jclParamDepartment = jclDepartmentId.getId();
|
||||
OrganizationAssert.isFalse(mergeParam.getId().equals(jclParamDepartment), "所选部门与待合并部门一致,无需操作");
|
||||
DepartmentPO targetDepartment = EcHrmRelationUtil.getJclDepartmentId(ecParamDepartment + "");
|
||||
|
||||
// 断言判断
|
||||
OrganizationAssert.isFalse(null == targetDepartment, "被合并部门数据有误,暂时无法合并");
|
||||
OrganizationAssert.isFalse(mergeParam.getId().equals(targetDepartment.getId()), "所选部门与待合并部门一致,无需操作");
|
||||
OrganizationAssert.notNull(mergeParam.getDepartment(), "请选择需要合并的部门");
|
||||
OrganizationAssert.notBlank(mergeParam.getMergeName(), "请输入合并后的名称");
|
||||
// 合并到的部门
|
||||
DepartmentPO targetDepartment = getDepartmentMapper().getDeptById(jclParamDepartment);
|
||||
|
||||
// 不可选择合并的数据,本身及子部门
|
||||
Set<Long> disableIds = new HashSet<>();
|
||||
// 添加选择部门本身
|
||||
disableIds.add(mergeParam.getId());
|
||||
List<DepartmentPO> deptListByPId = getDepartmentMapper().getDeptListByPId(mergeParam.getId());
|
||||
if (CollectionUtils.isNotEmpty(deptListByPId)) {
|
||||
|
|
@ -569,31 +576,62 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
}
|
||||
OrganizationAssert.isFalse(disableIds.contains(targetDepartment.getId()), "请勿选择当前部门本身及其子部门");
|
||||
|
||||
//TODO 被合并部门
|
||||
DepartmentPO mergeDepartment = getDepartmentMapper().getDeptById(mergeParam.getId());
|
||||
mergeDepartment.setDeptName(mergeParam.getMergeName());
|
||||
mergeDepartment.setDeptNameShort(mergeParam.getMergeName());
|
||||
|
||||
mergeDepartment.setParentDept(jclParamDepartment);
|
||||
mergeDepartment.setEcDepartment(ecParamDepartment);
|
||||
mergeDepartment.setParentComp(targetDepartment.getParentComp());
|
||||
mergeDepartment.setEcCompany(targetDepartment.getEcCompany());
|
||||
// 禁用
|
||||
mergeDepartment.setForbiddenTag(1);
|
||||
// 更新EC表部门
|
||||
updateEcDepartment(mergeDepartment);
|
||||
// 封存EC表部门
|
||||
cancelEcDepartment(mergeDepartment.getId());
|
||||
|
||||
updateCount = getDepartmentMapper().updateBaseDept(mergeDepartment);
|
||||
// 查询该部门下一级部门
|
||||
List<DepartmentPO> firstChildDeptList = getDepartmentMapper().getDeptListByPId(mergeParam.getId());
|
||||
// 更新所属部门、所属分部
|
||||
for (DepartmentPO departmentPO : firstChildDeptList) {
|
||||
departmentPO.setParentDept(targetDepartment.getId());
|
||||
departmentPO.setEcDepartment(ecParamDepartment);
|
||||
departmentPO.setParentComp(targetDepartment.getParentComp());
|
||||
departmentPO.setEcCompany(targetDepartment.getEcCompany());
|
||||
updateEcDepartment(departmentPO);
|
||||
getDepartmentMapper().updateBaseDept(departmentPO);
|
||||
// 更新组织架构图
|
||||
new Thread(new DepartmentTriggerRunnable(mergeDepartment.getId())).start();
|
||||
// 刷新岗位分部
|
||||
refreshJobComp(mergeDepartment.getId(), mergeDepartment.getParentComp());
|
||||
// 合并后部门及子部门禁用
|
||||
List<DepartmentPO> deptList = getDepartmentMapper().getDeptListByPId(mergeParam.getId());
|
||||
forbiddenChildTag(targetDepartment.getParentComp(), deptList, true);
|
||||
return updateCount;
|
||||
new Thread(new DepartmentTriggerRunnable(departmentPO.getId())).start();
|
||||
}
|
||||
// 查询该部门一级岗位、更新岗位所属分部、所属部门
|
||||
List<JobPO> firstChildJobList = getJobMapper().listJobsByDepartmentId(mergeParam.getId());
|
||||
// 批量更新部门、所属分部
|
||||
RecordSet rs = new RecordSet();
|
||||
String targetEcDeptId = EcHrmRelationUtil.getEcDepartmentId(targetDepartment.getId().toString());
|
||||
String mergeEcDeptId = EcHrmRelationUtil.getEcDepartmentId(mergeParam.getId().toString());
|
||||
rs.executeUpdate("update jcl_org_job set parent_comp =?,ec_company =?,parent_dept =?,ec_department =? where parent_dept =?", targetDepartment.getParentComp(), targetDepartment.getEcCompany(), targetDepartment.getId(), targetEcDeptId, mergeParam.getId());
|
||||
// 更新岗位组织架构图
|
||||
for (JobPO jobPO : firstChildJobList) {
|
||||
// 刷新组织架构图
|
||||
new Thread(new JobTriggerRunnable(jobPO.getId())).start();
|
||||
}
|
||||
// 更新当前部门下的人员
|
||||
List<Long> hrmResourceIds = getSystemDataMapper().getHrmResourceIdsByDept(mergeEcDeptId);
|
||||
rs.executeUpdate("update hrmresource set SUBCOMPANYID1 =?,DEPARTMENTID =? where DEPARTMENTID =?", targetDepartment.getEcCompany(), targetEcDeptId, mergeEcDeptId);
|
||||
// 更新人员组织架构图
|
||||
for (Long hrmResourceId : hrmResourceIds) {
|
||||
new Thread(new HrmResourceTriggerRunnable(hrmResourceId)).start();
|
||||
}
|
||||
// 更新子部门下岗位的所属分部
|
||||
for (DepartmentPO departmentPO : firstChildDeptList) {
|
||||
List<DepartmentPO> deptList = getDepartmentMapper().getDeptListByPId(departmentPO.getId());
|
||||
forbiddenChildTag(targetDepartment.getParentComp(), Util.null2String(targetDepartment.getEcCompany()), deptList);
|
||||
}
|
||||
// 原部门删除
|
||||
DepartmentPO mergeDepartment = getDepartmentMapper().getDeptById(mergeParam.getId());
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("id", mergeParam.getId());
|
||||
new OrganizationSyncEc(user, LogModuleNameEnum.DEPARTMENT, OperateTypeEnum.CANCELED, map).sync();
|
||||
// 删除拓展表、明细表
|
||||
MapperProxyFactory.getProxy(ExtMapper.class).deleteByID("jcl_org_deptext", mergeParam.getId());
|
||||
MapperProxyFactory.getProxy(ExtDTMapper.class).deleteByMainID("jcl_org_deptext_dt1", mergeParam.getId());
|
||||
getDepartmentMapper().deleteByIds(DeleteParam.builder().ids(mergeParam.getId().toString()).build().getIds());
|
||||
// 更新组织架构图
|
||||
new Thread(new DepartmentTriggerRunnable(mergeDepartment)).start();
|
||||
// 更新部门合并后名称
|
||||
targetDepartment.setDeptName(mergeParam.getMergeName());
|
||||
targetDepartment.setDeptNameShort(mergeParam.getMergeName());
|
||||
updateEcDepartment(targetDepartment);
|
||||
getDepartmentMapper().updateBaseDept(targetDepartment);
|
||||
// 更新组织架构图
|
||||
new Thread(new DepartmentTriggerRunnable(targetDepartment.getId())).start();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -656,7 +694,8 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
// 刷新岗位分部
|
||||
refreshJobComp(deptById.getId(), deptById.getParentComp());
|
||||
List<DepartmentPO> deptList = getDepartmentMapper().getDeptListByPId(deptById.getId());
|
||||
forbiddenChildTag(deptById.getParentComp(), deptList, false);
|
||||
String ecCompanyId = EcHrmRelationUtil.getEcCompanyId(Util.null2String(deptById.getParentComp()));
|
||||
forbiddenChildTag(deptById.getParentComp(), ecCompanyId, deptList);
|
||||
// 递归更新下级部门、岗位
|
||||
return updateBaseDept;
|
||||
}
|
||||
|
|
@ -667,19 +706,11 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
* @param parentComp
|
||||
* @param deptList
|
||||
*/
|
||||
void forbiddenChildTag(Long parentComp, List<DepartmentPO> deptList, boolean isForbidden) {
|
||||
void forbiddenChildTag(Long parentComp, String ecCompanyId, List<DepartmentPO> deptList) {
|
||||
if (CollectionUtils.isNotEmpty(deptList)) {
|
||||
for (DepartmentPO departmentPO : deptList) {
|
||||
departmentPO.setParentComp(parentComp);
|
||||
String ecCompanyId = EcHrmRelationUtil.getEcCompanyId(parentComp + "");
|
||||
if (StringUtils.isNotBlank(ecCompanyId)) {
|
||||
departmentPO.setEcCompany(Long.parseLong(ecCompanyId));
|
||||
}
|
||||
if (isForbidden) {
|
||||
departmentPO.setForbiddenTag(1);
|
||||
// 封存EC表部门
|
||||
cancelEcDepartment(departmentPO.getId());
|
||||
}
|
||||
// 更新EC表部门
|
||||
updateEcDepartment(departmentPO);
|
||||
|
||||
|
|
@ -688,8 +719,16 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
new Thread(new DepartmentTriggerRunnable(departmentPO.getId())).start();
|
||||
// 刷新岗位所属分部
|
||||
refreshJobComp(departmentPO.getId(), parentComp);
|
||||
// 更新当前部门下的人员
|
||||
List<Long> hrmResourceIds = getSystemDataMapper().getHrmResourceIdsByDept(departmentPO.getId().toString());
|
||||
String ecDepartmentId = EcHrmRelationUtil.getEcDepartmentId(departmentPO.getId().toString());
|
||||
new RecordSet().executeUpdate("update hrmresource set SUBCOMPANYID1 =? where DEPARTMENTID =?", ecCompanyId, ecDepartmentId);
|
||||
// 更新人员组织架构图
|
||||
for (Long hrmResourceId : hrmResourceIds) {
|
||||
new Thread(new HrmResourceTriggerRunnable(hrmResourceId)).start();
|
||||
}
|
||||
List<DepartmentPO> childList = getDepartmentMapper().getDeptListByPId(departmentPO.getId());
|
||||
forbiddenChildTag(parentComp, childList, isForbidden);
|
||||
forbiddenChildTag(parentComp, ecCompanyId, childList);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -883,6 +922,10 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
if (CollectionUtils.isNotEmpty(jobPOS)) {
|
||||
String ecCompanyId = EcHrmRelationUtil.getEcCompanyId(parentComp.toString());
|
||||
getJobMapper().updateJobCompany(jobPOS.stream().map(JobPO::getId).collect(Collectors.toList()), parentComp, ecCompanyId);
|
||||
for (JobPO jobPO : jobPOS) {
|
||||
// 刷新组织架构图
|
||||
new Thread(new JobTriggerRunnable(jobPO.getId())).start();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -12,9 +12,10 @@ import com.engine.hrm.entity.FieldSelectOptionBean;
|
|||
import com.engine.organization.component.OrganizationWeaTable;
|
||||
import com.engine.organization.entity.SelectOptionParam;
|
||||
import com.engine.organization.entity.commom.RecordInfo;
|
||||
import com.engine.organization.entity.extend.ExtendInfoOperateType;
|
||||
import com.engine.organization.entity.extend.param.ExtendInfoParams;
|
||||
import com.engine.organization.entity.extend.po.ExtendInfoPO;
|
||||
import com.engine.organization.entity.fieldset.param.FieldTypeTreeParam;
|
||||
import com.engine.organization.entity.fieldset.param.FieldTransferParam;
|
||||
import com.engine.organization.entity.jclimport.po.CusFormFieldPO;
|
||||
import com.engine.organization.entity.jclimport.po.JclImportHistoryDetailPO;
|
||||
import com.engine.organization.entity.jclimport.po.JclImportHistoryPO;
|
||||
|
|
@ -104,11 +105,13 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|||
extendType = "1";
|
||||
tableName = "JCL_ORG_COMP";
|
||||
excludeFields.add("parent_company");
|
||||
excludeFields.add("ec_company");
|
||||
break;
|
||||
case "department":
|
||||
extendType = "2";
|
||||
tableName = "JCL_ORG_DEPT";
|
||||
excludeFields.add("parent_dept");
|
||||
excludeFields.add("ec_department");
|
||||
break;
|
||||
case "jobtitle":
|
||||
extendType = "3";
|
||||
|
|
@ -153,17 +156,16 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|||
mergeList.addAll(hrmFieldBeanList);
|
||||
mergeList.addAll(customFieldList);
|
||||
|
||||
// TODO 分部、部门
|
||||
List<FieldTypeTreeParam> fieldDatas = mergeList.stream().map(item -> FieldTypeTreeParam.builder().id(item.getFieldId()).name(item.getFieldLabel()).build()).collect(Collectors.toList());
|
||||
List<Long> selectedKeys = mergeList.stream().filter(item -> ("1".equals(item.getRequired()) || "workcode".equals(item.getFieldName()) || "subcompanyid1".equals(item.getFieldName()) || "departmentid".equals(item.getFieldName()))).map(CusFormFieldPO::getFieldId).collect(Collectors.toList());
|
||||
List<FieldTransferParam> fieldDatas = mergeList.stream().map(item -> FieldTransferParam.builder().id(item.getTableName() + +item.getFieldId()).name(item.getFieldLabel()).build()).collect(Collectors.toList());
|
||||
List<String> selectedKeys = mergeList.stream().filter(item -> ("1".equals(item.getRequired()) || "workcode".equals(item.getFieldName()) || "subcompanyid1".equals(item.getFieldName()) || "departmentid".equals(item.getFieldName()))).map(item -> item.getTableName() + item.getFieldId()).collect(Collectors.toList());
|
||||
|
||||
returnMaps.put("data", fieldDatas);
|
||||
returnMaps.put("selectedKeys", selectedKeys);
|
||||
} else {
|
||||
List<ExtendInfoPO> infoPOList = getExtendInfoMapper().listFields(extendType, "", tableName, "", "1");
|
||||
List<ExtendInfoPO> infoPOList = getExtendInfoMapper().listFields(extendType, "", tableName, ExtendInfoOperateType.LIST.getValue(), "1");
|
||||
List<ExtendInfoPO> filterList = infoPOList.stream().filter(item -> !excludeFields.contains(item.getFieldName()) && 6 != item.getControlType()).collect(Collectors.toList());
|
||||
List<FieldTypeTreeParam> fieldDatas = filterList.stream().map(item -> FieldTypeTreeParam.builder().id(item.getId()).name(item.getFieldNameDesc()).build()).collect(Collectors.toList());
|
||||
List<Long> selectedKeys = filterList.stream().filter(item -> (0 == item.getIsSystemDefault()) && 1 == item.getIsrequired()).map(ExtendInfoPO::getId).collect(Collectors.toList());
|
||||
List<FieldTransferParam> fieldDatas = filterList.stream().map(item -> FieldTransferParam.builder().id(item.getId().toString()).name(item.getFieldNameDesc()).build()).collect(Collectors.toList());
|
||||
List<String> selectedKeys = filterList.stream().filter(item -> (0 == item.getIsSystemDefault()) && 1 == item.getIsrequired()).map(item -> item.getId().toString()).collect(Collectors.toList());
|
||||
returnMaps.put("data", fieldDatas);
|
||||
returnMaps.put("selectedKeys", selectedKeys);
|
||||
}
|
||||
|
|
@ -333,7 +335,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|||
lsPromptLabel.add(522355);
|
||||
lsPromptLabel.add(522356);
|
||||
lsPromptLabel.add(522357);
|
||||
lsPromptLabel.add(530411);
|
||||
//lsPromptLabel.add(530411);
|
||||
|
||||
for (int i = 0; i < lsPromptLabel.size(); i++) {
|
||||
Map<String, Object> item = new HashMap<>();
|
||||
|
|
@ -395,7 +397,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|||
lsPromptLabel.add(522355);
|
||||
lsPromptLabel.add(522356);
|
||||
lsPromptLabel.add(522357);
|
||||
lsPromptLabel.add(530411);
|
||||
//lsPromptLabel.add(530411);
|
||||
|
||||
for (int i = 0; i < lsPromptLabel.size(); i++) {
|
||||
Map<String, Object> item = new HashMap<>();
|
||||
|
|
@ -630,6 +632,9 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|||
}
|
||||
}
|
||||
map.put("parent_company", parentCompanyId);
|
||||
if (null != parentCompanyId) {
|
||||
map.put("ec_company", EcHrmRelationUtil.getEcCompanyId(parentCompanyId.toString()));
|
||||
}
|
||||
companyName = split[split.length - 1];
|
||||
map.put("comp_name", companyName);
|
||||
}
|
||||
|
|
@ -793,7 +798,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|||
}
|
||||
map.put(infoPO.getFieldName(), reallyValue);
|
||||
// 上级分部
|
||||
if ("parent_comp".equals(infoPO.getFieldName())) {
|
||||
if ("ec_company".equals(infoPO.getFieldName())) {
|
||||
String[] split = cellValue.split(">");
|
||||
if (split.length > 0) {
|
||||
if (split.length > 8) {
|
||||
|
|
@ -841,7 +846,11 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|||
}
|
||||
}
|
||||
map.put("parent_comp", parentCompanyId);
|
||||
map.put("ec_company", EcHrmRelationUtil.getEcCompanyId(parentCompanyId.toString()));
|
||||
map.put("parent_dept", parentDepartmentId);
|
||||
if(null!=parentDepartmentId){
|
||||
map.put("ec_department", EcHrmRelationUtil.getEcDepartmentId(parentCompanyId.toString()));
|
||||
}
|
||||
departmentName = split[split.length - 1];
|
||||
map.put("dept_name", departmentName);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -420,7 +420,12 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
DepartmentPO jclDepartmentId = EcHrmRelationUtil.getJclDepartmentId(department);
|
||||
if (null != jclDepartmentId) {
|
||||
jobById.setParentDept(jclDepartmentId.getId());
|
||||
//分部赋值
|
||||
jobById.setEcCompany(jclDepartmentId.getEcCompany());
|
||||
jobById.setParentComp(jclDepartmentId.getParentComp());
|
||||
}
|
||||
// 清空上级岗位
|
||||
jobById.setParentJob(null);
|
||||
jobById.setShowOrder(orderNum);
|
||||
insertCount += getJobMapper().insertIgnoreNull(jobById);
|
||||
// 更新组织架构图
|
||||
|
|
|
|||
|
|
@ -50,6 +50,9 @@ public class EcHrmRelationUtil {
|
|||
public static String getEcCompanyId(String companyId) {
|
||||
CompPO compPO = getCompMapper().listById(Long.parseLong(companyId));
|
||||
RecordInfo supSubCompany = getSystemDataMapper().getHrmObjectByUUID(HRM_COMPANY, compPO.getUuid());
|
||||
if (null == supSubCompany) {
|
||||
return "0";
|
||||
}
|
||||
return supSubCompany.getId();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ public class HrmImportAdaptExcelE9 extends BaseBean implements IHrmImportAdapt {
|
|||
//标准模板字段
|
||||
private String tempField = "所属分部,部门," +
|
||||
"编号,姓名,登录名,密码,安全级别,性别," +
|
||||
"岗位,职务,职务类别,职称,职级," +
|
||||
"岗位,职务,职务类别,职称," +
|
||||
"职责描述,直接上级,助理,状态," +
|
||||
"办公室,办公地点,办公电话,移动电话,其他电话," +
|
||||
"传真,电子邮件,系统语言,出生日期,民族," +
|
||||
|
|
@ -82,7 +82,7 @@ public class HrmImportAdaptExcelE9 extends BaseBean implements IHrmImportAdapt {
|
|||
//标准导入字段
|
||||
private String voField = "subcompanyid1,departmentid," +
|
||||
"workcode,lastname,loginid,password,seclevel,sex," +
|
||||
"jobtitle,jobactivityid,jobgroupid,jobcall,joblevel," +
|
||||
"jobtitle,jobactivityid,jobgroupid,jobcall," +
|
||||
"jobactivitydesc,managerid,assistantid,status," +
|
||||
"workroom,locationid,telephone,mobile,mobilecall," +
|
||||
"fax,email,systemlanguage,birthday,folk," +
|
||||
|
|
|
|||
|
|
@ -232,7 +232,7 @@ public class HrmImportProcessE9 extends BaseBean {
|
|||
Class<HrmResourceVo> voClass = HrmResourceVo.class;
|
||||
|
||||
String field = "id,subcompanyid1,departmentid,workcode,lastname,"
|
||||
+ "loginid,password,seclevel,sex,jobtitle,jobcall,joblevel,"
|
||||
+ "loginid,password,seclevel,sex,jobtitle,jobcall,"
|
||||
+ "jobactivitydesc,managerid,assistantid,status,locationid,workroom,"
|
||||
+ "telephone,mobile,mobilecall,fax,email,"
|
||||
+ "systemlanguage,birthday,folk,nativeplace,regresidentplace,"
|
||||
|
|
@ -634,12 +634,12 @@ public class HrmImportProcessE9 extends BaseBean {
|
|||
}
|
||||
|
||||
//职级
|
||||
if (isInteger(vo.getJoblevel())) {
|
||||
int joblevel = vo.getJoblevel().equals("") ? 0 : Integer.parseInt(vo.getJoblevel());
|
||||
hrm.setJoblevel((short) joblevel);
|
||||
} else {
|
||||
hrm.setJoblevel((short) 0);
|
||||
}
|
||||
//if (isInteger(vo.getJoblevel())) {
|
||||
// int joblevel = vo.getJoblevel().equals("") ? 0 : Integer.parseInt(vo.getJoblevel());
|
||||
// hrm.setJoblevel((short) joblevel);
|
||||
//} else {
|
||||
// hrm.setJoblevel((short) 0);
|
||||
//}
|
||||
//用工性质
|
||||
if (vo.getUsekind() != null) {
|
||||
int usekind = getUseKind(vo.getUsekind());
|
||||
|
|
@ -1203,10 +1203,10 @@ public class HrmImportProcessE9 extends BaseBean {
|
|||
}
|
||||
|
||||
//职级
|
||||
if (isInteger(vo.getJoblevel())) {
|
||||
int joblevel = vo.getJoblevel().equals("") ? 0 : Integer.parseInt(vo.getJoblevel());
|
||||
hrm.setJoblevel((short) joblevel);
|
||||
}
|
||||
//if (isInteger(vo.getJoblevel())) {
|
||||
// int joblevel = vo.getJoblevel().equals("") ? 0 : Integer.parseInt(vo.getJoblevel());
|
||||
// hrm.setJoblevel((short) joblevel);
|
||||
//}
|
||||
|
||||
//用工性质
|
||||
if (vo.getUsekind() != null) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue