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.
weaver-hrm-organization/src/com/engine/organization/wrapper/DepartmentWrapper.java

234 lines
7.0 KiB
Java

3 years ago
package com.engine.organization.wrapper;
import com.alibaba.fastjson.JSON;
3 years ago
import com.api.browser.bean.SearchConditionGroup;
3 years ago
import com.engine.common.util.ServiceUtil;
import com.engine.organization.annotation.Log;
import com.engine.organization.entity.department.param.*;
3 years ago
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;
3 years ago
import com.engine.organization.service.DepartmentService;
import com.engine.organization.service.impl.DepartmentServiceImpl;
import com.engine.organization.util.OrganizationWrapper;
3 years ago
import com.engine.organization.util.page.PageInfo;
import com.engine.organization.util.response.ReturnResult;
import weaver.hrm.User;
3 years ago
import java.util.Collection;
3 years ago
import java.util.List;
import java.util.Map;
3 years ago
/**
* @Author weaver_cl
3 years ago
* @description:
3 years ago
* @Date 2022/5/20
* @Version V1.0
**/
public class DepartmentWrapper extends OrganizationWrapper {
3 years ago
public DepartmentService getDepartmentService(User user) {
return ServiceUtil.getService(DepartmentServiceImpl.class, user);
3 years ago
}
public ReturnResult getDeptListByPid(QuerySingleDeptListParam param) {
PageInfo<SingleDeptTreeVO> singleDeptTreeVOS = getDepartmentService(user).getDeptListByPid(param);
return ReturnResult.successed(singleDeptTreeVOS);
}
3 years ago
/**
*
*
* @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);
}
3 years ago
/**
*
*
* @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();
}
3 years ago
/**
*
*
* @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;
3 years ago
}
/**
*
*
* @param params
*/
@Log(operateType = OperateTypeEnum.UPDATE, operateDesc = "更新部门禁用标记", operateModule = LogModuleNameEnum.DEPARTMENT)
3 years ago
public int updateForbiddenTagById(DeptSearchParam params) {
int updateForbiddenTagById = getDepartmentService(user).updateForbiddenTagById(params);
writeOperateLog(new Object() {
}.getClass(), "更新部门禁用标记【" + JSON.toJSONString(params) + "】");
return updateForbiddenTagById;
3 years ago
}
/**
*
*
* @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;
3 years ago
}
/**
* ID
*
* @param ids
*/
@Log(operateType = OperateTypeEnum.DELETE, operateDesc = "删除部门", operateModule = LogModuleNameEnum.DEPARTMENT)
3 years ago
public int deleteByIds(Collection<Long> ids) {
int deleteByIds = getDepartmentService(user).deleteByIds(ids);
writeOperateLog(new Object() {
}.getClass(), "删除部门【" + JSON.toJSONString(ids) + "】");
return deleteByIds;
3 years ago
}
/**
*
*
* @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);
}
3 years ago
/**
*
*
* @return
*/
public List<SearchConditionGroup> getCopyForm() {
return getDepartmentService(user).getCopyForm();
}
/**
*
*
* @param copyParam
* @return
*/
@Log(operateType = OperateTypeEnum.ADD, operateDesc = "复制部门", operateModule = LogModuleNameEnum.DEPARTMENT)
3 years ago
public int copyDepartment(DeptCopyParam copyParam) {
int copyDepartment = getDepartmentService(user).copyDepartment(copyParam);
writeOperateLog(new Object() {
}.getClass(), "复制部门【" + JSON.toJSONString(copyParam) + "】");
return copyDepartment;
3 years ago
}
/**
*
*
* @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;
}
3 years ago
/**
*
*
* @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;
}
3 years ago
}