commit
db07451ece
|
|
@ -32,4 +32,5 @@ public class CusFormFieldPO {
|
||||||
*/
|
*/
|
||||||
private String dmlUrl;
|
private String dmlUrl;
|
||||||
private String tableName;
|
private String tableName;
|
||||||
|
private String scopeId;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
package com.engine.organization.entity.job.bo;
|
package com.engine.organization.entity.job.bo;
|
||||||
|
|
||||||
import com.engine.organization.entity.company.po.CompPO;
|
|
||||||
import com.engine.organization.entity.department.po.DepartmentPO;
|
|
||||||
import com.engine.organization.entity.job.dto.JobListDTO;
|
import com.engine.organization.entity.job.dto.JobListDTO;
|
||||||
import com.engine.organization.entity.job.param.JobSearchParam;
|
import com.engine.organization.entity.job.param.JobSearchParam;
|
||||||
import com.engine.organization.entity.job.po.JobPO;
|
import com.engine.organization.entity.job.po.JobPO;
|
||||||
|
|
@ -10,7 +8,6 @@ import com.engine.organization.entity.searchtree.SearchTree;
|
||||||
import com.engine.organization.mapper.job.JobMapper;
|
import com.engine.organization.mapper.job.JobMapper;
|
||||||
import com.engine.organization.transmethod.JobTransMethod;
|
import com.engine.organization.transmethod.JobTransMethod;
|
||||||
import com.engine.organization.util.db.MapperProxyFactory;
|
import com.engine.organization.util.db.MapperProxyFactory;
|
||||||
import com.engine.organization.util.relation.EcHrmRelationUtil;
|
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
import weaver.general.Util;
|
import weaver.general.Util;
|
||||||
|
|
||||||
|
|
@ -29,8 +26,6 @@ public class JobBO {
|
||||||
if (null == param) {
|
if (null == param) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
CompPO jclCompany = EcHrmRelationUtil.getJclCompanyId(null == param.getEcCompany() ? Util.null2String(param.getSubcompanyid1()) : param.getEcCompany().toString());
|
|
||||||
DepartmentPO jclDepartment = EcHrmRelationUtil.getJclDepartmentId(null == param.getEcDepartment() ? Util.null2String(param.getDepartmentid()) : param.getEcDepartment().toString());
|
|
||||||
return JobPO
|
return JobPO
|
||||||
.builder()
|
.builder()
|
||||||
.id(param.getId() == null ? 0 : param.getId())
|
.id(param.getId() == null ? 0 : param.getId())
|
||||||
|
|
@ -38,8 +33,8 @@ public class JobBO {
|
||||||
.jobName(param.getJobName())
|
.jobName(param.getJobName())
|
||||||
.ecCompany(param.getEcCompany())
|
.ecCompany(param.getEcCompany())
|
||||||
.ecDepartment(param.getEcDepartment())
|
.ecDepartment(param.getEcDepartment())
|
||||||
.parentComp(null == jclCompany ? param.getSubcompanyid1() : jclCompany.getId())
|
.parentComp(param.getSubcompanyid1())
|
||||||
.parentDept(null == jclDepartment ? param.getDepartmentid() : jclDepartment.getId())
|
.parentDept( param.getDepartmentid())
|
||||||
.sequenceId(param.getSequenceId())
|
.sequenceId(param.getSequenceId())
|
||||||
.schemeId(param.getSchemeId())
|
.schemeId(param.getSchemeId())
|
||||||
.parentJob(param.getParentJob())
|
.parentJob(param.getParentJob())
|
||||||
|
|
|
||||||
|
|
@ -17,11 +17,11 @@ import lombok.NoArgsConstructor;
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public class JobMergeParam {
|
public class JobMergeParam {
|
||||||
/**
|
/**
|
||||||
* 所选分部
|
* 所选岗位
|
||||||
*/
|
*/
|
||||||
private Long id;
|
private Long id;
|
||||||
/**
|
/**
|
||||||
* 合并分部
|
* 合并到的岗位
|
||||||
*/
|
*/
|
||||||
private Long targetJob;
|
private Long targetJob;
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@
|
||||||
<result column="fieldhtmltype" property="fieldHtmlType"/>
|
<result column="fieldhtmltype" property="fieldHtmlType"/>
|
||||||
<result column="type" property="type"/>
|
<result column="type" property="type"/>
|
||||||
<result column="dmlurl" property="dmlUrl"/>
|
<result column="dmlurl" property="dmlUrl"/>
|
||||||
|
<result column="scopeid" property="scopeId"/>
|
||||||
<result column="tablename" property="tableName"/>
|
<result column="tablename" property="tableName"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
|
|
@ -123,6 +124,7 @@
|
||||||
</select>
|
</select>
|
||||||
<select id="getHrmFieldBeanList" resultMap="CustomFieldMap">
|
<select id="getHrmFieldBeanList" resultMap="CustomFieldMap">
|
||||||
select b.labelname as fieldlable,
|
select b.labelname as fieldlable,
|
||||||
|
'0' as scopeid,
|
||||||
a.fieldid,
|
a.fieldid,
|
||||||
a.fieldname,
|
a.fieldname,
|
||||||
a.ismand,
|
a.ismand,
|
||||||
|
|
@ -136,6 +138,7 @@
|
||||||
</select>
|
</select>
|
||||||
<select id="getHrmCustomFieldList" resultMap="CustomFieldMap">
|
<select id="getHrmCustomFieldList" resultMap="CustomFieldMap">
|
||||||
select b.labelname as fieldlable,
|
select b.labelname as fieldlable,
|
||||||
|
a.scopeid,
|
||||||
a.fieldid,
|
a.fieldid,
|
||||||
a.hrm_fieldlable as fieldname,
|
a.hrm_fieldlable as fieldname,
|
||||||
a.ismand,
|
a.ismand,
|
||||||
|
|
@ -159,6 +162,7 @@
|
||||||
a.ismand,
|
a.ismand,
|
||||||
a.fieldhtmltype,
|
a.fieldhtmltype,
|
||||||
a.type,
|
a.type,
|
||||||
|
'0' as scopeid,
|
||||||
'hrmresource' as tablename
|
'hrmresource' as tablename
|
||||||
from hrm_formfield a
|
from hrm_formfield a
|
||||||
inner join htmllabelinfo b on a.fieldlabel = b.indexid and b.languageid = 7
|
inner join htmllabelinfo b on a.fieldlabel = b.indexid and b.languageid = 7
|
||||||
|
|
|
||||||
|
|
@ -108,7 +108,7 @@ public interface JobService {
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<SearchConditionGroup> getMergeForm();
|
List<SearchConditionGroup> getMergeForm(Long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 合并岗位
|
* 合并岗位
|
||||||
|
|
|
||||||
|
|
@ -474,11 +474,11 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
||||||
List<SearchConditionItem> condition = new ArrayList<>();
|
List<SearchConditionItem> condition = new ArrayList<>();
|
||||||
SearchConditionItem compBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 3, false, "复制到", "164", "company", "");
|
SearchConditionItem compBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 3, false, "复制到", "164", "company", "");
|
||||||
compBrowserItem.setRules("required|string");
|
compBrowserItem.setRules("required|string");
|
||||||
SearchConditionItem isCheckItem = OrganizationFormItemUtil.selectItem(user, Lists.newArrayList(new SearchConditionOption("1", "")), 2, 5, 10, false, "是否复制岗位信息", "copyJob");
|
SearchConditionItem isCheckItem = OrganizationFormItemUtil.selectItem(user, Lists.newArrayList(new SearchConditionOption("1", "")), 2, 5, 10, false, "复制岗位信息", "copyJob");
|
||||||
isCheckItem.setDetailtype(2);
|
isCheckItem.setDetailtype(2);
|
||||||
SearchConditionItem copySubDeptItem = OrganizationFormItemUtil.selectItem(user, Lists.newArrayList(new SearchConditionOption("1", "")), 2, 5, 10, false, "是否复制子部门信息", "copySubDept");
|
SearchConditionItem copySubDeptItem = OrganizationFormItemUtil.selectItem(user, Lists.newArrayList(new SearchConditionOption("1", "")), 2, 5, 10, false, "复制子部门信息", "copySubDept");
|
||||||
copySubDeptItem.setDetailtype(2);
|
copySubDeptItem.setDetailtype(2);
|
||||||
SearchConditionItem copySubJob = OrganizationFormItemUtil.selectItem(user, Lists.newArrayList(new SearchConditionOption("1", "")), 2, 5, 10, false, "是否复制子部门岗位信息", "copySubJob");
|
SearchConditionItem copySubJob = OrganizationFormItemUtil.selectItem(user, Lists.newArrayList(new SearchConditionOption("1", "")), 2, 5, 10, false, "复制子部门岗位信息", "copySubJob");
|
||||||
copySubJob.setDetailtype(2);
|
copySubJob.setDetailtype(2);
|
||||||
condition.add(compBrowserItem);
|
condition.add(compBrowserItem);
|
||||||
condition.add(isCheckItem);
|
condition.add(isCheckItem);
|
||||||
|
|
@ -878,11 +878,14 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
||||||
|
|
||||||
// 处理自动编号
|
// 处理自动编号
|
||||||
jobPO.setJobNo(CodeRuleUtil.generateCode(RuleCodeType.JOBTITLES, jobPO.getJobNo(), timeMillis));
|
jobPO.setJobNo(CodeRuleUtil.generateCode(RuleCodeType.JOBTITLES, jobPO.getJobNo(), timeMillis));
|
||||||
jobPO.setEcDepartment(parentDeptId);
|
|
||||||
DepartmentPO jclDepartmentId = EcHrmRelationUtil.getJclDepartmentId(Util.null2String(parentDeptId));
|
// 所属部门赋值
|
||||||
if (null != jclDepartmentId) {
|
jobPO.setParentDept(parentDeptId);
|
||||||
jobPO.setParentDept(jclDepartmentId.getId());
|
String ecDepartmentId = EcHrmRelationUtil.getEcDepartmentId(parentDeptId.toString());
|
||||||
|
if (StringUtils.isNotBlank(ecDepartmentId)) {
|
||||||
|
jobPO.setEcDepartment(Long.parseLong(ecDepartmentId));
|
||||||
}
|
}
|
||||||
|
// 所属分部赋值
|
||||||
jobPO.setEcCompany(parentCompId);
|
jobPO.setEcCompany(parentCompId);
|
||||||
CompPO jclCompanyId = EcHrmRelationUtil.getJclCompanyId(Util.null2String(parentCompId));
|
CompPO jclCompanyId = EcHrmRelationUtil.getJclCompanyId(Util.null2String(parentCompId));
|
||||||
if (null != jclCompanyId) {
|
if (null != jclCompanyId) {
|
||||||
|
|
|
||||||
|
|
@ -136,7 +136,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
||||||
if ("4".equals(extendType)) {
|
if ("4".equals(extendType)) {
|
||||||
String voField = "subcompanyid1,departmentid," +
|
String voField = "subcompanyid1,departmentid," +
|
||||||
"workcode,lastname,loginid,password,seclevel,sex," +
|
"workcode,lastname,loginid,password,seclevel,sex," +
|
||||||
"jobtitle,jobactivity,jobgroupid,jobcall,joblevel," +
|
// "jobtitle,jobactivity,jobgroupid,jobcall,joblevel," +
|
||||||
"jobactivitydesc,managerid,assistantid,status," +
|
"jobactivitydesc,managerid,assistantid,status," +
|
||||||
"workroom,locationid,telephone,mobile,mobilecall," +
|
"workroom,locationid,telephone,mobile,mobilecall," +
|
||||||
"fax,email,systemlanguage,birthday,folk," +
|
"fax,email,systemlanguage,birthday,folk," +
|
||||||
|
|
@ -156,8 +156,8 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
||||||
mergeList.addAll(hrmFieldBeanList);
|
mergeList.addAll(hrmFieldBeanList);
|
||||||
mergeList.addAll(customFieldList);
|
mergeList.addAll(customFieldList);
|
||||||
|
|
||||||
List<FieldTransferParam> fieldDatas = mergeList.stream().map(item -> FieldTransferParam.builder().id(item.getTableName() + +item.getFieldId()).name(item.getFieldLabel()).build()).collect(Collectors.toList());
|
List<FieldTransferParam> fieldDatas = mergeList.stream().map(item -> FieldTransferParam.builder().id(item.getScopeId() + 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());
|
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.getScopeId() + item.getTableName() + item.getFieldId()).collect(Collectors.toList());
|
||||||
|
|
||||||
returnMaps.put("data", fieldDatas);
|
returnMaps.put("data", fieldDatas);
|
||||||
returnMaps.put("selectedKeys", selectedKeys);
|
returnMaps.put("selectedKeys", selectedKeys);
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,7 @@ import com.engine.organization.service.ExtService;
|
||||||
import com.engine.organization.service.JobService;
|
import com.engine.organization.service.JobService;
|
||||||
import com.engine.organization.thread.JobTriggerRunnable;
|
import com.engine.organization.thread.JobTriggerRunnable;
|
||||||
import com.engine.organization.thread.OrganizationSyncEc;
|
import com.engine.organization.thread.OrganizationSyncEc;
|
||||||
|
import com.engine.organization.trigger.cusfielddata.CusFieldDataTrigger;
|
||||||
import com.engine.organization.util.*;
|
import com.engine.organization.util.*;
|
||||||
import com.engine.organization.util.coderule.CodeRuleUtil;
|
import com.engine.organization.util.coderule.CodeRuleUtil;
|
||||||
import com.engine.organization.util.db.MapperProxyFactory;
|
import com.engine.organization.util.db.MapperProxyFactory;
|
||||||
|
|
@ -478,24 +479,34 @@ public class JobServiceImpl extends Service implements JobService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<SearchConditionGroup> getMergeForm() {
|
public List<SearchConditionGroup> getMergeForm(Long id) {
|
||||||
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||||
List<SearchConditionItem> condition = new ArrayList<>();
|
List<SearchConditionItem> condition = new ArrayList<>();
|
||||||
SearchConditionItem deptBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 3, false, "合并到岗位", "666", "targetJob", "");
|
SearchConditionItem deptBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 3, false, "合并到岗位", "666", "targetJob", "");
|
||||||
deptBrowserItem.setRules("required");
|
deptBrowserItem.setRules("required");
|
||||||
|
SearchConditionItem mergeNameItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 3, 50, "合并后名称", "mergeName");
|
||||||
|
mergeNameItem.setRules("required|string");
|
||||||
|
JobPO jobById = getJobMapper().getJobById(id);
|
||||||
|
if (null != jobById) {
|
||||||
|
String jobName = jobById.getJobName();
|
||||||
|
mergeNameItem.setValue(jobName);
|
||||||
|
}
|
||||||
condition.add(deptBrowserItem);
|
condition.add(deptBrowserItem);
|
||||||
|
condition.add(mergeNameItem);
|
||||||
addGroups.add(new SearchConditionGroup("", true, condition));
|
addGroups.add(new SearchConditionGroup("", true, condition));
|
||||||
return addGroups;
|
return addGroups;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int mergeJob(JobMergeParam mergeParam) {
|
public int mergeJob(JobMergeParam mergeParam) {
|
||||||
//TODO 人员合并
|
|
||||||
HasRightUtil.hasRight(user, RIGHT_NAME, false);
|
HasRightUtil.hasRight(user, RIGHT_NAME, false);
|
||||||
int updateCount;
|
int updateCount = 0;
|
||||||
OrganizationAssert.notNull(mergeParam.getTargetJob(), "请选择需要合并的岗位");
|
OrganizationAssert.notNull(mergeParam.getTargetJob(), "请选择需要合并的岗位");
|
||||||
|
|
||||||
|
// 不可选择岗位本身、以及子岗位
|
||||||
Set<Long> disableIds = new HashSet<>();
|
Set<Long> disableIds = new HashSet<>();
|
||||||
disableIds.add(mergeParam.getId());
|
disableIds.add(mergeParam.getId());
|
||||||
|
// 第一层级的子元素
|
||||||
List<JobPO> jobs = getJobMapper().getJobsByPid(mergeParam.getId());
|
List<JobPO> jobs = getJobMapper().getJobsByPid(mergeParam.getId());
|
||||||
if (CollectionUtils.isNotEmpty(jobs)) {
|
if (CollectionUtils.isNotEmpty(jobs)) {
|
||||||
addDisableIds(disableIds, jobs);
|
addDisableIds(disableIds, jobs);
|
||||||
|
|
@ -504,28 +515,70 @@ public class JobServiceImpl extends Service implements JobService {
|
||||||
|
|
||||||
// 合并到的岗位
|
// 合并到的岗位
|
||||||
JobPO targetJob = getJobMapper().getJobById(mergeParam.getTargetJob());
|
JobPO targetJob = getJobMapper().getJobById(mergeParam.getTargetJob());
|
||||||
Long parentDept = targetJob.getParentDept();
|
// 合并后名称
|
||||||
Long parentComp = targetJob.getParentComp();
|
targetJob.setJobName(mergeParam.getMergeName());
|
||||||
|
|
||||||
// 原岗位禁用
|
// 待合并的部门
|
||||||
JobPO mergeJob = getJobMapper().getJobById(mergeParam.getId());
|
JobPO jobById = getJobMapper().getJobById(mergeParam.getId());
|
||||||
mergeJob.setForbiddenTag(1);
|
|
||||||
mergeJob.setParentComp(targetJob.getParentComp());
|
// 递归处理子岗位所属分部、所部部门、上级岗位
|
||||||
mergeJob.setParentDept(targetJob.getParentDept());
|
recursionMergeJob(jobs, targetJob.getParentComp(), targetJob.getEcCompany(), targetJob.getParentDept(), targetJob.getEcDepartment(), targetJob.getId());
|
||||||
mergeJob.setParentJob(targetJob.getId());
|
|
||||||
new OrganizationSyncEc(user, LogModuleNameEnum.JOB, OperateTypeEnum.CANCELED, null, mergeJob).sync();
|
// 人员信息变动,更新分部、部门、岗位
|
||||||
|
RecordSet rs = new RecordSet();
|
||||||
|
rs.executeUpdate("SELECT ID FROM CUS_FIELDDATA WHERE SCOPEID =-1 AND FIELD100002 = ?", jobById.getId());
|
||||||
|
while (rs.next()) {
|
||||||
|
long userId = Long.parseLong(Util.null2String(rs.getString("ID")));
|
||||||
|
// 更新人员分部、部门
|
||||||
|
rs.executeUpdate("UPDATE HRMRESOURCE SET SUBCOMPANYID1 = ? , DEPARTMENTID = ? WHERE ID =? ", targetJob.getEcCompany(), targetJob.getEcDepartment(), userId);
|
||||||
|
// 更新岗位 、岗位更新触发器
|
||||||
|
// TODO
|
||||||
|
rs.executeUpdate("",null);
|
||||||
|
CusFieldDataTrigger.run(userId);
|
||||||
|
// 更新人员组织架构图
|
||||||
|
}
|
||||||
|
// 更新合并后的岗位,更新组织架构图
|
||||||
|
updateEcJob(targetJob,mergeParam.getMergeName());
|
||||||
|
|
||||||
|
targetJob.setJobName(mergeParam.getMergeName());
|
||||||
|
getJobMapper().updateBaseJob(targetJob);
|
||||||
|
new Thread(new JobTriggerRunnable(targetJob.getId())).start();
|
||||||
|
// 原岗位删除
|
||||||
|
jobById.setForbiddenTag(1);
|
||||||
|
new OrganizationSyncEc(user, LogModuleNameEnum.JOB, OperateTypeEnum.CANCELED, null, jobById).sync();
|
||||||
|
|
||||||
updateCount = getJobMapper().updateBaseJob(mergeJob);
|
|
||||||
// 更新组织架构图
|
// 更新组织架构图
|
||||||
new Thread(new JobTriggerRunnable(mergeJob.getId())).start();
|
new Thread(new JobTriggerRunnable(jobById)).start();
|
||||||
//TODO 合并该刚岗位下的人员
|
|
||||||
|
|
||||||
// 合并后岗位及子岗位禁用
|
|
||||||
List<JobPO> jobList = getJobMapper().getJobsByPid(mergeParam.getId());
|
|
||||||
forbiddenChildTag(parentComp, parentDept, targetJob.getId(), jobList);
|
|
||||||
return updateCount;
|
return updateCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void recursionMergeJob(List<JobPO> jobs, Long parentCompany, Long ecCompany, Long parentDepartment, Long ecDepartment, Long parentJob) {
|
||||||
|
for (JobPO job : jobs) {
|
||||||
|
job.setParentComp(parentCompany);
|
||||||
|
job.setEcCompany(ecCompany);
|
||||||
|
job.setParentDept(parentDepartment);
|
||||||
|
job.setEcDepartment(ecDepartment);
|
||||||
|
job.setParentJob(parentJob);
|
||||||
|
// 更新人员信息
|
||||||
|
RecordSet rs = new RecordSet();
|
||||||
|
rs.executeUpdate("SELECT ID FROM CUS_FIELDDATA WHERE SCOPEID =-1 AND FIELD100002 = ?", job.getId());
|
||||||
|
while (rs.next()) {
|
||||||
|
long userId = Long.parseLong(Util.null2String(rs.getString("ID")));
|
||||||
|
// 更新人员分部、部门
|
||||||
|
rs.executeUpdate("UPDATE HRMRESOURCE SET SUBCOMPANYID1 = ? , DEPARTMENTID = ? WHERE ID =? ", ecCompany, ecDepartment, userId);
|
||||||
|
// 更新人员组织架构图
|
||||||
|
CusFieldDataTrigger.run(userId);
|
||||||
|
}
|
||||||
|
// 更新组织架构图
|
||||||
|
new Thread(new JobTriggerRunnable(job.getId())).start();
|
||||||
|
|
||||||
|
// 递归处理子级元素
|
||||||
|
List<JobPO> jobsByPid = getJobMapper().getJobsByPid(job.getId());
|
||||||
|
recursionMergeJob(jobsByPid, parentCompany, ecCompany, parentDepartment, ecDepartment, parentJob);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加查询元素的父级元素
|
* 添加查询元素的父级元素
|
||||||
*
|
*
|
||||||
|
|
@ -717,4 +770,19 @@ public class JobServiceImpl extends Service implements JobService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新EC岗位
|
||||||
|
* @param jobPO
|
||||||
|
*/
|
||||||
|
private void updateEcJob(JobPO jobPO,String newName){
|
||||||
|
Map<String, Object> params = new HashMap<>();
|
||||||
|
params.put("job_name", newName);
|
||||||
|
params.put("jobactivityid", JOB_ACTIVITY_ID);
|
||||||
|
params.put("work_duty", jobPO.getWorkDuty());
|
||||||
|
params.put("work_authority", jobPO.getWorkAuthority());
|
||||||
|
params.put("description", jobPO.getDescription());
|
||||||
|
params.put("job_no", jobPO.getJobNo());
|
||||||
|
new OrganizationSyncEc(user, LogModuleNameEnum.JOB, OperateTypeEnum.UPDATE, params, jobPO).sync();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ public class HrmImportAdaptExcelE9 extends BaseBean implements IHrmImportAdapt {
|
||||||
//标准模板字段
|
//标准模板字段
|
||||||
private String tempField = "所属分部,部门," +
|
private String tempField = "所属分部,部门," +
|
||||||
"编号,姓名,登录名,密码,安全级别,性别," +
|
"编号,姓名,登录名,密码,安全级别,性别," +
|
||||||
"岗位,职务,职务类别,职称," +
|
// "岗位,职务,职务类别,职称," +
|
||||||
"职责描述,直接上级,助理,状态," +
|
"职责描述,直接上级,助理,状态," +
|
||||||
"办公室,办公地点,办公电话,移动电话,其他电话," +
|
"办公室,办公地点,办公电话,移动电话,其他电话," +
|
||||||
"传真,电子邮件,系统语言,出生日期,民族," +
|
"传真,电子邮件,系统语言,出生日期,民族," +
|
||||||
|
|
@ -82,7 +82,7 @@ public class HrmImportAdaptExcelE9 extends BaseBean implements IHrmImportAdapt {
|
||||||
//标准导入字段
|
//标准导入字段
|
||||||
private String voField = "subcompanyid1,departmentid," +
|
private String voField = "subcompanyid1,departmentid," +
|
||||||
"workcode,lastname,loginid,password,seclevel,sex," +
|
"workcode,lastname,loginid,password,seclevel,sex," +
|
||||||
"jobtitle,jobactivityid,jobgroupid,jobcall," +
|
// "jobtitle,jobactivityid,jobgroupid,jobcall," +
|
||||||
"jobactivitydesc,managerid,assistantid,status," +
|
"jobactivitydesc,managerid,assistantid,status," +
|
||||||
"workroom,locationid,telephone,mobile,mobilecall," +
|
"workroom,locationid,telephone,mobile,mobilecall," +
|
||||||
"fax,email,systemlanguage,birthday,folk," +
|
"fax,email,systemlanguage,birthday,folk," +
|
||||||
|
|
@ -653,28 +653,28 @@ public class HrmImportAdaptExcelE9 extends BaseBean implements IHrmImportAdapt {
|
||||||
return flag;
|
return flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 岗位
|
//// 岗位
|
||||||
if (fieldName.equals("jobtitle") && cellValue.equals("")) {
|
//if (fieldName.equals("jobtitle") && cellValue.equals("")) {
|
||||||
flag = false;
|
// flag = false;
|
||||||
msg = getCellPosition(cellNum, rowNum + 1) + "[" + temFields[fieldIndex] + "]"; //【岗位】为必填
|
// msg = getCellPosition(cellNum, rowNum + 1) + "[" + temFields[fieldIndex] + "]"; //【岗位】为必填
|
||||||
errorInfo.add(msg + " " + SystemEnv.getHtmlLabelName(83626, userlanguage));
|
// errorInfo.add(msg + " " + SystemEnv.getHtmlLabelName(83626, userlanguage));
|
||||||
return flag;
|
// return flag;
|
||||||
}
|
//}
|
||||||
|
//
|
||||||
if (fieldName.equals("jobactivityid") && cellValue.equals("")) {
|
//if (fieldName.equals("jobactivityid") && cellValue.equals("")) {
|
||||||
flag = false;
|
// flag = false;
|
||||||
msg = getCellPosition(cellNum, rowNum + 1) + "[" + temFields[fieldIndex] + "]"; //【职务】为必填
|
// msg = getCellPosition(cellNum, rowNum + 1) + "[" + temFields[fieldIndex] + "]"; //【职务】为必填
|
||||||
errorInfo.add(msg + " " + SystemEnv.getHtmlLabelName(83626, userlanguage));
|
// errorInfo.add(msg + " " + SystemEnv.getHtmlLabelName(83626, userlanguage));
|
||||||
return flag;
|
// return flag;
|
||||||
}
|
//}
|
||||||
|
//
|
||||||
|
//
|
||||||
if (fieldName.equals("jobgroupid") && cellValue.equals("")) {
|
//if (fieldName.equals("jobgroupid") && cellValue.equals("")) {
|
||||||
flag = false;
|
// flag = false;
|
||||||
msg = getCellPosition(cellNum, rowNum + 1) + "[" + temFields[fieldIndex] + "]"; //【职务类别】为必填
|
// msg = getCellPosition(cellNum, rowNum + 1) + "[" + temFields[fieldIndex] + "]"; //【职务类别】为必填
|
||||||
errorInfo.add(msg + " " + SystemEnv.getHtmlLabelName(83626, userlanguage));
|
// errorInfo.add(msg + " " + SystemEnv.getHtmlLabelName(83626, userlanguage));
|
||||||
return flag;
|
// return flag;
|
||||||
}
|
//}
|
||||||
|
|
||||||
|
|
||||||
// 办公地点
|
// 办公地点
|
||||||
|
|
|
||||||
|
|
@ -232,8 +232,8 @@ public class HrmImportProcessE9 extends BaseBean {
|
||||||
Class<HrmResourceVo> voClass = HrmResourceVo.class;
|
Class<HrmResourceVo> voClass = HrmResourceVo.class;
|
||||||
|
|
||||||
String field = "id,subcompanyid1,departmentid,workcode,lastname,"
|
String field = "id,subcompanyid1,departmentid,workcode,lastname,"
|
||||||
+ "loginid,password,seclevel,sex,jobtitle,jobcall,"
|
+ "loginid,password,seclevel,sex,"
|
||||||
+ "jobactivitydesc,managerid,assistantid,status,locationid,workroom,"
|
+ "managerid,assistantid,status,locationid,workroom,"
|
||||||
+ "telephone,mobile,mobilecall,fax,email,"
|
+ "telephone,mobile,mobilecall,fax,email,"
|
||||||
+ "systemlanguage,birthday,folk,nativeplace,regresidentplace,"
|
+ "systemlanguage,birthday,folk,nativeplace,regresidentplace,"
|
||||||
+ "certificatenum,maritalstatus,policy,bememberdate,bepartydate,"
|
+ "certificatenum,maritalstatus,policy,bememberdate,bepartydate,"
|
||||||
|
|
@ -1675,7 +1675,7 @@ public class HrmImportProcessE9 extends BaseBean {
|
||||||
if (flag) {
|
if (flag) {
|
||||||
boolean execute = recordSet.execute(sql);
|
boolean execute = recordSet.execute(sql);
|
||||||
// 更新聚才林相关字段
|
// 更新聚才林相关字段
|
||||||
new CusFieldDataTrigger().run((long) id);
|
CusFieldDataTrigger.run((long) id);
|
||||||
return !execute;
|
return !execute;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -2085,60 +2085,60 @@ public class HrmImportProcessE9 extends BaseBean {
|
||||||
* @param jobgroupname 职务类别
|
* @param jobgroupname 职务类别
|
||||||
* @return -1:职务类别不存在,-2:职务不存在,-3:岗位名称不存在
|
* @return -1:职务类别不存在,-2:职务不存在,-3:岗位名称不存在
|
||||||
*/
|
*/
|
||||||
public int getJobTitles(String jobtitlename, String jobactivityname,
|
//public int getJobTitles(String jobtitlename, String jobactivityname,
|
||||||
String jobgroupname) {
|
// String jobgroupname) {
|
||||||
RecordSet rs = new RecordSet();
|
// RecordSet rs = new RecordSet();
|
||||||
RecordSet recordSet = new RecordSet();
|
// RecordSet recordSet = new RecordSet();
|
||||||
String sqlInsert;
|
// String sqlInsert;
|
||||||
|
//
|
||||||
jobgroupname = Util.convertInput2DB4(jobgroupname);
|
// jobgroupname = Util.convertInput2DB4(jobgroupname);
|
||||||
jobactivityname = Util.convertInput2DB4(jobactivityname);
|
// jobactivityname = Util.convertInput2DB4(jobactivityname);
|
||||||
|
//
|
||||||
/* 获取jobgroupid 职务类别 */
|
// /* 获取jobgroupid 职务类别 */
|
||||||
String selSql = "select id from HrmJobGroups where ltrim(rtrim(dbo.convToMultiLang(ltrim(rtrim(jobgroupname))," + userlanguage + ")))='" + jobgroupname + "'";
|
// String selSql = "select id from HrmJobGroups where ltrim(rtrim(dbo.convToMultiLang(ltrim(rtrim(jobgroupname))," + userlanguage + ")))='" + jobgroupname + "'";
|
||||||
if (recordSet.getDBType().equalsIgnoreCase("oracle") || DialectUtil.isMySql(recordSet.getDBType()) || recordSet.getDBType().equalsIgnoreCase("postgresql")) {
|
// if (recordSet.getDBType().equalsIgnoreCase("oracle") || DialectUtil.isMySql(recordSet.getDBType()) || recordSet.getDBType().equalsIgnoreCase("postgresql")) {
|
||||||
selSql = "select id from HrmJobGroups where ltrim(rtrim(convToMultiLang(ltrim(rtrim(jobgroupname))," + userlanguage + ")))='" + jobgroupname + "'";
|
// selSql = "select id from HrmJobGroups where ltrim(rtrim(convToMultiLang(ltrim(rtrim(jobgroupname))," + userlanguage + ")))='" + jobgroupname + "'";
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
int jobgroupid = getResultSetId(selSql);
|
// int jobgroupid = getResultSetId(selSql);
|
||||||
|
//
|
||||||
if (jobgroupid == 0) {
|
// if (jobgroupid == 0) {
|
||||||
return -1;
|
// return -1;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
/* 获取jobactivityid 职务 */
|
// /* 获取jobactivityid 职务 */
|
||||||
selSql = "select id from HrmJobActivities where ltrim(rtrim(dbo.convToMultiLang(ltrim(rtrim(jobactivityname))," + userlanguage + ")))='" + jobactivityname + "' and jobgroupid=" + jobgroupid;
|
// selSql = "select id from HrmJobActivities where ltrim(rtrim(dbo.convToMultiLang(ltrim(rtrim(jobactivityname))," + userlanguage + ")))='" + jobactivityname + "' and jobgroupid=" + jobgroupid;
|
||||||
if (recordSet.getDBType().equalsIgnoreCase("oracle") || DialectUtil.isMySql(recordSet.getDBType()) || recordSet.getDBType().equalsIgnoreCase("postgresql")) {
|
// if (recordSet.getDBType().equalsIgnoreCase("oracle") || DialectUtil.isMySql(recordSet.getDBType()) || recordSet.getDBType().equalsIgnoreCase("postgresql")) {
|
||||||
selSql = "select id from HrmJobActivities where ltrim(rtrim(convToMultiLang(ltrim(rtrim(jobactivityname))," + userlanguage + ")))='" + jobactivityname + "' and jobgroupid=" + jobgroupid;
|
// selSql = "select id from HrmJobActivities where ltrim(rtrim(convToMultiLang(ltrim(rtrim(jobactivityname))," + userlanguage + ")))='" + jobactivityname + "' and jobgroupid=" + jobgroupid;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
int jobactivityid = getResultSetId(selSql);
|
// int jobactivityid = getResultSetId(selSql);
|
||||||
|
//
|
||||||
if (jobactivityid == 0) {
|
// if (jobactivityid == 0) {
|
||||||
return -2;
|
// return -2;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
/*获取岗位id*/
|
// /*获取岗位id*/
|
||||||
selSql = "select id from HrmJobTitles where ltrim(rtrim(dbo.convToMultiLang(ltrim(rtrim(jobtitlemark))," + userlanguage + ")))='" + jobtitlename + "' and jobactivityid=" + jobactivityid;
|
// selSql = "select id from HrmJobTitles where ltrim(rtrim(dbo.convToMultiLang(ltrim(rtrim(jobtitlemark))," + userlanguage + ")))='" + jobtitlename + "' and jobactivityid=" + jobactivityid;
|
||||||
if (recordSet.getDBType().equalsIgnoreCase("oracle") || DialectUtil.isMySql(recordSet.getDBType()) || recordSet.getDBType().equalsIgnoreCase("postgresql")) {
|
// if (recordSet.getDBType().equalsIgnoreCase("oracle") || DialectUtil.isMySql(recordSet.getDBType()) || recordSet.getDBType().equalsIgnoreCase("postgresql")) {
|
||||||
selSql = "select id from HrmJobTitles where ltrim(rtrim(convToMultiLang(ltrim(rtrim(jobtitlemark))," + userlanguage + ")))='" + jobtitlename + "' and jobactivityid=" + jobactivityid;
|
// selSql = "select id from HrmJobTitles where ltrim(rtrim(convToMultiLang(ltrim(rtrim(jobtitlemark))," + userlanguage + ")))='" + jobtitlename + "' and jobactivityid=" + jobactivityid;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
int jobtitle = getResultSetId(selSql);
|
// int jobtitle = getResultSetId(selSql);
|
||||||
|
//
|
||||||
if (jobtitle == 0) {
|
// if (jobtitle == 0) {
|
||||||
return -3;
|
// return -3;
|
||||||
|
//
|
||||||
} else {
|
// } else {
|
||||||
selSql = "select * from HrmJobTitles where id = '" + jobtitle + "' and jobactivityid = '" + jobactivityid + "' ";
|
// selSql = "select * from HrmJobTitles where id = '" + jobtitle + "' and jobactivityid = '" + jobactivityid + "' ";
|
||||||
recordSet.executeSql(selSql);
|
// recordSet.executeSql(selSql);
|
||||||
if (!recordSet.next()) {//查询这个名称已存在的岗位,对应的职务是否存在。如果对应职务的岗位不存在,则说明岗位对应的职务和职务类别有更新
|
// if (!recordSet.next()) {//查询这个名称已存在的岗位,对应的职务是否存在。如果对应职务的岗位不存在,则说明岗位对应的职务和职务类别有更新
|
||||||
sqlInsert = "update HrmJobTitles set jobactivityid = '" + jobactivityid + "'," + DbFunctionUtil.getUpdateSetSql(rs.getDBType(), 1) + " where id = '" + jobtitle + "' ";
|
// sqlInsert = "update HrmJobTitles set jobactivityid = '" + jobactivityid + "'," + DbFunctionUtil.getUpdateSetSql(rs.getDBType(), 1) + " where id = '" + jobtitle + "' ";
|
||||||
rs.executeSql(sqlInsert);
|
// rs.executeSql(sqlInsert);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
return jobtitle;
|
// return jobtitle;
|
||||||
}
|
//}
|
||||||
|
|
||||||
|
|
||||||
public static boolean needCheckLicenseForUpdate(ResourceComInfo resourceComInfo, String hrmId, HrmResourceVo vo) {
|
public static boolean needCheckLicenseForUpdate(ResourceComInfo resourceComInfo, String hrmId, HrmResourceVo vo) {
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ import com.engine.organization.entity.searchtree.SearchTreeParams;
|
||||||
import com.engine.organization.util.response.ReturnResult;
|
import com.engine.organization.util.response.ReturnResult;
|
||||||
import com.engine.organization.wrapper.JobWrapper;
|
import com.engine.organization.wrapper.JobWrapper;
|
||||||
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import weaver.hrm.HrmUserVarify;
|
import weaver.hrm.HrmUserVarify;
|
||||||
import weaver.hrm.User;
|
import weaver.hrm.User;
|
||||||
|
|
||||||
|
|
@ -283,7 +284,12 @@ public class JobController {
|
||||||
public ReturnResult getMergeForm(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
public ReturnResult getMergeForm(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||||
try {
|
try {
|
||||||
User user = HrmUserVarify.getUser(request, response);
|
User user = HrmUserVarify.getUser(request, response);
|
||||||
return ReturnResult.successed(getJobWrapper(user).getMergeForm());
|
Map<String, Object> map = ParamUtil.request2Map(request);
|
||||||
|
String id = (String) map.get("id");
|
||||||
|
if (StringUtils.isBlank(id)) {
|
||||||
|
id = "0";
|
||||||
|
}
|
||||||
|
return ReturnResult.successed(getJobWrapper(user).getMergeForm(Long.parseLong(id)));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
return ReturnResult.exceptionHandle(e);
|
return ReturnResult.exceptionHandle(e);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -218,8 +218,8 @@ public class JobWrapper extends OrganizationWrapper {
|
||||||
return ReturnResult.successed(hrmListByJobId);
|
return ReturnResult.successed(hrmListByJobId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<SearchConditionGroup> getMergeForm() {
|
public List<SearchConditionGroup> getMergeForm(Long id) {
|
||||||
return getJobService(user).getMergeForm();
|
return getJobService(user).getMergeForm(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Log(operateType = OperateTypeEnum.MERGE, operateModule = LogModuleNameEnum.JOB, operateDesc = "合并岗位")
|
@Log(operateType = OperateTypeEnum.MERGE, operateModule = LogModuleNameEnum.JOB, operateDesc = "合并岗位")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue