You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
234 lines
6.9 KiB
Java
234 lines
6.9 KiB
Java
package com.engine.organization.wrapper;
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.api.browser.bean.SearchConditionGroup;
|
|
import com.engine.common.util.ServiceUtil;
|
|
import com.engine.organization.annotation.Log;
|
|
import com.engine.organization.entity.department.param.*;
|
|
import com.engine.organization.entity.department.vo.SingleDeptTreeVO;
|
|
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.service.DepartmentService;
|
|
import com.engine.organization.service.impl.DepartmentServiceImpl;
|
|
import com.engine.organization.util.OrganizationWrapper;
|
|
import com.engine.organization.util.page.PageInfo;
|
|
import com.engine.organization.util.response.ReturnResult;
|
|
import weaver.hrm.User;
|
|
|
|
import java.util.Collection;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
|
|
/**
|
|
* @Author weaver_cl
|
|
* @description:
|
|
* @Date 2022/5/20
|
|
* @Version V1.0
|
|
**/
|
|
public class DepartmentWrapper extends OrganizationWrapper {
|
|
|
|
public DepartmentService getDepartmentService(User user) {
|
|
return ServiceUtil.getService(DepartmentServiceImpl.class, user);
|
|
}
|
|
|
|
public ReturnResult getDeptListByPid(QuerySingleDeptListParam param) {
|
|
PageInfo<SingleDeptTreeVO> singleDeptTreeVOS = getDepartmentService(user).getDeptListByPid(param);
|
|
return ReturnResult.successed(singleDeptTreeVOS);
|
|
}
|
|
|
|
/**
|
|
* 部门联查岗位
|
|
*
|
|
* @param param
|
|
* @return
|
|
*/
|
|
public PageInfo<SingleJobTreeVO> getJobListByPid(QuerySingleDeptListParam param) {
|
|
return getDepartmentService(user).getJobListByPid(param);
|
|
}
|
|
|
|
/**
|
|
* 左侧树
|
|
*
|
|
* @param params
|
|
* @return
|
|
*/
|
|
public Map<String, Object> getSearchTree(SearchTreeParams params) {
|
|
return getDepartmentService(user).getSearchTree(params);
|
|
}
|
|
|
|
/**
|
|
* 列表数据展示
|
|
*
|
|
* @param param
|
|
* @return
|
|
*/
|
|
public Map<String, Object> listPage(DeptSearchParam param) {
|
|
return getDepartmentService(user).listPage(param);
|
|
}
|
|
|
|
/**
|
|
* 获取保存表单
|
|
*
|
|
* @return
|
|
*/
|
|
public Map<String, Object> getSaveForm() {
|
|
return getDepartmentService(user).getSaveForm();
|
|
}
|
|
|
|
/**
|
|
* 保存部门基础信息
|
|
*
|
|
* @param params
|
|
* @return
|
|
*/
|
|
@Log(operateType = OperateTypeEnum.ADD, operateDesc = "新增部门", operateModule = LogModuleNameEnum.DEPARTMENT)
|
|
public Long saveBaseForm(Map<String, Object> params) {
|
|
Long departmentId = getDepartmentService(user).saveBaseForm(params);
|
|
writeOperateLog(new Object() {
|
|
}.getClass(), JSON.toJSONString(params));
|
|
return departmentId;
|
|
}
|
|
|
|
|
|
/**
|
|
* 更新禁用标记
|
|
*
|
|
* @param params
|
|
*/
|
|
@Log(operateType = OperateTypeEnum.UPDATE, operateDesc = "更新部门禁用标记", operateModule = LogModuleNameEnum.DEPARTMENT)
|
|
public int updateForbiddenTagById(DeptSearchParam params) {
|
|
int updateForbiddenTagById = getDepartmentService(user).updateForbiddenTagById(params);
|
|
writeOperateLog(new Object() {
|
|
}.getClass(), JSON.toJSONString(params));
|
|
return updateForbiddenTagById;
|
|
}
|
|
|
|
/**
|
|
* 更新分部主表、拓展表、明细表
|
|
*
|
|
* @param params
|
|
* @return
|
|
*/
|
|
@Log(operateType = OperateTypeEnum.UPDATE, operateDesc = "更新部门信息", operateModule = LogModuleNameEnum.DEPARTMENT)
|
|
public Long updateForm(Map<String, Object> params) {
|
|
Long departmentId = getDepartmentService(user).updateForm(params);
|
|
writeOperateLog(new Object() {
|
|
}.getClass(), JSON.toJSONString(params));
|
|
return departmentId;
|
|
}
|
|
|
|
/**
|
|
* 根据ID批量删除
|
|
*
|
|
* @param ids
|
|
*/
|
|
@Log(operateType = OperateTypeEnum.DELETE, operateDesc = "删除部门", operateModule = LogModuleNameEnum.DEPARTMENT)
|
|
public int deleteByIds(Collection<Long> ids) {
|
|
int deleteByIds = getDepartmentService(user).deleteByIds(ids);
|
|
writeOperateLog(new Object() {
|
|
}.getClass(), JSON.toJSONString(ids));
|
|
return deleteByIds;
|
|
}
|
|
|
|
/**
|
|
* 获取搜索条件
|
|
*
|
|
* @param params
|
|
* @return
|
|
*/
|
|
public Map<String, Object> getSearchCondition(Map<String, Object> params) {
|
|
return getDepartmentService(user).getSearchCondition(params);
|
|
}
|
|
|
|
/**
|
|
* 获取列表页面按钮信息
|
|
*
|
|
* @return
|
|
*/
|
|
public Map<String, Object> getHasRight() {
|
|
return getDepartmentService(user).getHasRight();
|
|
}
|
|
|
|
/**
|
|
* 获取基本信息表单
|
|
*
|
|
* @param params
|
|
* @return
|
|
*/
|
|
public Map<String, Object> getDeptBaseForm(Map<String, Object> params) {
|
|
return getDepartmentService(user).getDeptBaseForm(params);
|
|
}
|
|
|
|
/**
|
|
* 复制表单
|
|
*
|
|
* @return
|
|
*/
|
|
public List<SearchConditionGroup> getCopyForm() {
|
|
return getDepartmentService(user).getCopyForm();
|
|
}
|
|
|
|
/**
|
|
* 复制岗位到指定部门
|
|
*
|
|
* @param copyParam
|
|
* @return
|
|
*/
|
|
@Log(operateType = OperateTypeEnum.ADD, operateDesc = "复制部门", operateModule = LogModuleNameEnum.DEPARTMENT)
|
|
public int copyDepartment(DeptCopyParam copyParam) {
|
|
int copyDepartment = getDepartmentService(user).copyDepartment(copyParam);
|
|
writeOperateLog(new Object() {
|
|
}.getClass(), JSON.toJSONString(copyParam));
|
|
return copyDepartment;
|
|
}
|
|
|
|
/**
|
|
* 获取合并表单
|
|
*
|
|
* @param id
|
|
* @return
|
|
*/
|
|
public List<SearchConditionGroup> getMergeForm(Long id) {
|
|
return getDepartmentService(user).getMergeForm(id);
|
|
}
|
|
|
|
/**
|
|
* 合并到指定部门
|
|
*
|
|
* @param mergeParam
|
|
* @return
|
|
*/
|
|
@Log(operateType = OperateTypeEnum.UPDATE, operateDesc = "合并部门", operateModule = LogModuleNameEnum.DEPARTMENT)
|
|
public int mergeDepartment(DepartmentMergeParam mergeParam) {
|
|
int mergeDepartment = getDepartmentService(user).mergeDepartment(mergeParam);
|
|
writeOperateLog(new Object() {
|
|
}.getClass(), "合并部门【" + JSON.toJSONString(mergeParam) + "】");
|
|
return mergeDepartment;
|
|
}
|
|
|
|
/**
|
|
* 获取转移表单
|
|
*
|
|
* @return
|
|
*/
|
|
public List<SearchConditionGroup> getMoveForm() {
|
|
return getDepartmentService(user).getMoveForm();
|
|
}
|
|
|
|
/**
|
|
* 转移到指定分部或部门
|
|
*
|
|
* @param moveParam
|
|
* @return
|
|
*/
|
|
@Log(operateType = OperateTypeEnum.UPDATE, operateDesc = "转移部门", operateModule = LogModuleNameEnum.DEPARTMENT)
|
|
public int moveDepartment(DepartmentMoveParam moveParam) {
|
|
int moveDepartment = getDepartmentService(user).moveDepartment(moveParam);
|
|
writeOperateLog(new Object() {
|
|
}.getClass(), "转移部门【" + JSON.toJSONString(moveParam) + "】");
|
|
return moveDepartment;
|
|
}
|
|
}
|