|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
package com.engine.organization.wrapper;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
|
import com.api.browser.bean.SearchConditionGroup;
|
|
|
|
|
import com.engine.common.util.ServiceUtil;
|
|
|
|
@ -9,21 +10,23 @@ import com.engine.organization.entity.company.po.CompPO;
|
|
|
|
|
import com.engine.organization.entity.department.param.*;
|
|
|
|
|
import com.engine.organization.entity.department.po.DepartmentPO;
|
|
|
|
|
import com.engine.organization.entity.department.vo.SingleDeptTreeVO;
|
|
|
|
|
import com.engine.organization.entity.hrmresource.po.ResourceChartPO;
|
|
|
|
|
import com.engine.organization.entity.job.vo.SingleJobTreeVO;
|
|
|
|
|
import com.engine.organization.entity.searchtree.SearchTreeParams;
|
|
|
|
|
import com.engine.organization.enums.LogModuleNameEnum;
|
|
|
|
|
import com.engine.organization.enums.OperateTypeEnum;
|
|
|
|
|
import com.engine.organization.mapper.comp.CompMapper;
|
|
|
|
|
import com.engine.organization.mapper.department.DepartmentMapper;
|
|
|
|
|
import com.engine.organization.mapper.resource.HrmResourceMapper;
|
|
|
|
|
import com.engine.organization.service.DepartmentService;
|
|
|
|
|
import com.engine.organization.service.impl.DepartmentServiceImpl;
|
|
|
|
|
import com.engine.organization.util.HrmStatusHistoryUtil;
|
|
|
|
|
import com.engine.organization.util.MenuBtn;
|
|
|
|
|
import com.engine.organization.util.OrganizationWrapper;
|
|
|
|
|
import com.engine.organization.util.db.MapperProxyFactory;
|
|
|
|
|
import com.engine.organization.util.page.PageInfo;
|
|
|
|
|
import com.engine.organization.util.response.ReturnResult;
|
|
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
|
|
import weaver.general.Util;
|
|
|
|
|
import weaver.hrm.User;
|
|
|
|
|
|
|
|
|
|
import java.util.Collection;
|
|
|
|
@ -46,6 +49,10 @@ public class DepartmentWrapper extends OrganizationWrapper {
|
|
|
|
|
private DepartmentMapper getDepartmentMapper() {
|
|
|
|
|
return MapperProxyFactory.getProxy(DepartmentMapper.class);
|
|
|
|
|
}
|
|
|
|
|
private HrmResourceMapper getHrmResourceMapper() {
|
|
|
|
|
return MapperProxyFactory.getProxy(HrmResourceMapper.class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private CompMapper getCompMapper() {
|
|
|
|
|
return MapperProxyFactory.getProxy(CompMapper.class);
|
|
|
|
|
}
|
|
|
|
@ -236,7 +243,12 @@ public class DepartmentWrapper extends OrganizationWrapper {
|
|
|
|
|
@Log(operateType = OperateTypeEnum.MERGE, operateDesc = "合并部门", operateModule = LogModuleNameEnum.DEPARTMENT)
|
|
|
|
|
public int mergeDepartment(DepartmentMergeParam mergeParam) {
|
|
|
|
|
DepartmentPO departmentPO = getDepartmentMapper().getDeptById(mergeParam.getId());
|
|
|
|
|
//被合并的部门人员工作记录表记录调动
|
|
|
|
|
List<ResourceChartPO> resourceChartPOList = getHrmResourceMapper().selectByDepartmentId(mergeParam.getDepartment());
|
|
|
|
|
int mergeDepartment = getDepartmentService(user).mergeDepartment(mergeParam);
|
|
|
|
|
if (CollectionUtil.isNotEmpty(resourceChartPOList)) {
|
|
|
|
|
HrmStatusHistoryUtil.personWorkRecord(resourceChartPOList,mergeParam.getId(),"合并部门");
|
|
|
|
|
}
|
|
|
|
|
writeOperateLog(new Object() {
|
|
|
|
|
}.getClass(), departmentPO.getDepartmentName(), JSON.toJSONString(mergeParam), departmentPO, getDepartmentMapper().getDeptById(departmentPO.getId()));
|
|
|
|
|
return mergeDepartment;
|
|
|
|
|