|
|
|
@ -6,9 +6,11 @@ import com.api.browser.bean.SearchConditionItem;
|
|
|
|
|
import com.cloudstore.eccom.result.WeaResultMsg;
|
|
|
|
|
import com.engine.common.util.ServiceUtil;
|
|
|
|
|
import com.engine.core.impl.Service;
|
|
|
|
|
import com.engine.hrm.entity.RuleCodeType;
|
|
|
|
|
import com.engine.hrm.util.face.HrmFaceCheckManager;
|
|
|
|
|
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;
|
|
|
|
|
import com.engine.organization.entity.company.po.CompPO;
|
|
|
|
@ -19,6 +21,7 @@ import com.engine.organization.entity.hrmresource.bo.HrmRelationBO;
|
|
|
|
|
import com.engine.organization.entity.hrmresource.param.HrmRelationSaveParam;
|
|
|
|
|
import com.engine.organization.entity.hrmresource.param.HrmResourceSearchParam;
|
|
|
|
|
import com.engine.organization.entity.hrmresource.po.HrmRelationPO;
|
|
|
|
|
import com.engine.organization.entity.hrmresource.po.HrmResourcePO;
|
|
|
|
|
import com.engine.organization.entity.hrmresource.vo.HrmResourceVO;
|
|
|
|
|
import com.engine.organization.entity.job.bo.JobBO;
|
|
|
|
|
import com.engine.organization.entity.job.po.JobPO;
|
|
|
|
@ -26,6 +29,7 @@ import com.engine.organization.entity.searchtree.SearchTree;
|
|
|
|
|
import com.engine.organization.entity.searchtree.SearchTreeParams;
|
|
|
|
|
import com.engine.organization.enums.LogModuleNameEnum;
|
|
|
|
|
import com.engine.organization.enums.OperateTypeEnum;
|
|
|
|
|
import com.engine.organization.mapper.codesetting.CodeRuleMapper;
|
|
|
|
|
import com.engine.organization.mapper.comp.CompMapper;
|
|
|
|
|
import com.engine.organization.mapper.department.DepartmentMapper;
|
|
|
|
|
import com.engine.organization.mapper.extend.ExtendTitleMapper;
|
|
|
|
@ -35,6 +39,7 @@ import com.engine.organization.mapper.hrmresource.SystemDataMapper;
|
|
|
|
|
import com.engine.organization.mapper.job.JobMapper;
|
|
|
|
|
import com.engine.organization.mapper.post.PostInfoMapper;
|
|
|
|
|
import com.engine.organization.mapper.post.PostMapper;
|
|
|
|
|
import com.engine.organization.mapper.resource.ResourceMapper;
|
|
|
|
|
import com.engine.organization.mapper.scheme.GradeMapper;
|
|
|
|
|
import com.engine.organization.mapper.scheme.LevelMapper;
|
|
|
|
|
import com.engine.organization.mapper.scheme.SchemeMapper;
|
|
|
|
@ -47,6 +52,7 @@ import com.engine.organization.util.HasRightUtil;
|
|
|
|
|
import com.engine.organization.util.MenuBtn;
|
|
|
|
|
import com.engine.organization.util.OrganizationAssert;
|
|
|
|
|
import com.engine.organization.util.OrganizationFormItemUtil;
|
|
|
|
|
import com.engine.organization.util.coderule.CodeRuleUtil;
|
|
|
|
|
import com.engine.organization.util.db.DBType;
|
|
|
|
|
import com.engine.organization.util.db.MapperProxyFactory;
|
|
|
|
|
import com.engine.organization.util.page.PageUtil;
|
|
|
|
@ -153,6 +159,10 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|
|
|
|
return MapperProxyFactory.getProxy(HrmResourceMapper.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static ResourceMapper getResourceMapper() {
|
|
|
|
|
return MapperProxyFactory.getProxy(ResourceMapper.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private ExtendTitleMapper getExtendTitleMapper() {
|
|
|
|
|
return MapperProxyFactory.getProxy(ExtendTitleMapper.class);
|
|
|
|
|
}
|
|
|
|
@ -206,7 +216,10 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|
|
|
|
@Override
|
|
|
|
|
public Long saveBaseForm(Map<String, Object> params) {
|
|
|
|
|
HasRightUtil.hasRight(user, RIGHT_NAME, false);
|
|
|
|
|
|
|
|
|
|
String workCode = (String) params.get("work_code");
|
|
|
|
|
// 判断是否开启自动编号
|
|
|
|
|
workCode = repeatDetermine(workCode);
|
|
|
|
|
params.put("work_code", workCode);
|
|
|
|
|
// 完善新增参数
|
|
|
|
|
completeParams(params);
|
|
|
|
|
|
|
|
|
@ -271,6 +284,13 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|
|
|
|
if ("0".equals(groupId)) {
|
|
|
|
|
groupId = GROUP_ID.toString();
|
|
|
|
|
}
|
|
|
|
|
// 判断编号是否重复
|
|
|
|
|
String workCode = Util.null2String(params.get("work_code"));
|
|
|
|
|
HrmResourcePO resourceById = getResourceMapper().getResourceById(id.toString());
|
|
|
|
|
if (!workCode.equals(resourceById.getWorkCode())) {
|
|
|
|
|
workCode = repeatDetermine(workCode);
|
|
|
|
|
params.put("work_code", workCode);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 完善更新参数
|
|
|
|
|
completeParams(params);
|
|
|
|
@ -576,7 +596,9 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|
|
|
|
for (DepartmentPO departmentPO : filterDeparts) {
|
|
|
|
|
buildParentDepts(departmentPO, builderDeparts);
|
|
|
|
|
}
|
|
|
|
|
List<SearchTree> deptTrees = SearchTreeUtil.builderTreeMode(DepartmentBO.buildSetToSearchTree(builderDeparts, false));
|
|
|
|
|
List<SearchTree> departmentList = DepartmentBO.buildSetToSearchTree(builderDeparts, false);
|
|
|
|
|
List<SearchTree> deptTrees = SearchTreeUtil.builderTreeMode(departmentList);
|
|
|
|
|
List<SearchTree> searchTrees = SearchTreeUtil.builderTreeMode(departmentList, jobTrees);
|
|
|
|
|
// 添加部门的上级分部
|
|
|
|
|
String parentCompS = deptTrees.stream().map(SearchTree::getParentComp).collect(Collectors.joining(","));
|
|
|
|
|
if (!StringUtil.isEmpty(parentCompS)) {
|
|
|
|
@ -589,7 +611,6 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|
|
|
|
for (CompPO compPO : filterComps) {
|
|
|
|
|
buildParentComps(compPO, builderComps);
|
|
|
|
|
}
|
|
|
|
|
List<SearchTree> searchTrees = SearchTreeUtil.builderTreeMode(deptTrees, jobTrees);
|
|
|
|
|
return SearchTreeUtil.builderTreeMode(CompBO.buildSetToSearchTree(builderComps), searchTrees);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -682,8 +703,11 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|
|
|
|
params.put("company_id", jobById.getParentComp());
|
|
|
|
|
params.put("ec_department", jobById.getEcDepartment());
|
|
|
|
|
params.put("ec_company", jobById.getEcCompany());
|
|
|
|
|
// 职级
|
|
|
|
|
params.put("job_level", jobById.getGradeId());
|
|
|
|
|
// 等级方案、岗位序列、职等、职级
|
|
|
|
|
params.put("scheme_id", jobById.getSchemeId());
|
|
|
|
|
params.put("sequence_id", jobById.getSequenceId());
|
|
|
|
|
params.put("job_level", jobById.getLevelId());
|
|
|
|
|
params.put("job_grade", jobById.getGradeId());
|
|
|
|
|
String showOrder = Util.null2String(params.get("show_order"));
|
|
|
|
|
// 初始化排序字段
|
|
|
|
|
if (StringUtils.isBlank(showOrder)) {
|
|
|
|
@ -698,4 +722,37 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 判断编号是否重复
|
|
|
|
|
*
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public static String repeatDetermine(String workCode) {
|
|
|
|
|
CodeRulePO codeRuleByType = MapperProxyFactory.getProxy(CodeRuleMapper.class).getCodeRuleByType(RuleCodeType.USER.getValue());
|
|
|
|
|
if (StringUtils.isNotBlank(workCode)) {
|
|
|
|
|
workCode = CodeRuleUtil.generateCode(RuleCodeType.USER, workCode);
|
|
|
|
|
List<HrmResourcePO> list = getResourceMapper().listByNo(Util.null2String(workCode));
|
|
|
|
|
OrganizationAssert.isEmpty(list, "编号不允许重复");
|
|
|
|
|
} else {
|
|
|
|
|
if (null != codeRuleByType && "1".equals(codeRuleByType.getSerialEnable())) {
|
|
|
|
|
workCode = autoCreateWorkCode();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return workCode;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 自动编号处理
|
|
|
|
|
*
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
private static String autoCreateWorkCode() {
|
|
|
|
|
String generateCode = CodeRuleUtil.generateCode(RuleCodeType.USER, "");
|
|
|
|
|
List<HrmResourcePO> list = getResourceMapper().listByNo(Util.null2String(generateCode));
|
|
|
|
|
if (CollectionUtils.isNotEmpty(list)) {
|
|
|
|
|
generateCode = autoCreateWorkCode();
|
|
|
|
|
}
|
|
|
|
|
return generateCode;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|