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/CompWrapper.java

158 lines
4.7 KiB
Java

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

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.company.param.CompSearchParam;
import com.engine.organization.entity.department.param.DepartmentMoveParam;
import com.engine.organization.enums.LogModuleNameEnum;
import com.engine.organization.enums.OperateTypeEnum;
import com.engine.organization.service.CompService;
import com.engine.organization.service.impl.CompServiceImpl;
import com.engine.organization.util.OrganizationWrapper;
import weaver.hrm.User;
import java.util.Collection;
import java.util.List;
import java.util.Map;
/**
* @description:
* @author:dxfeng
* @createTime: 2022/05/16
* @version: 1.0
*/
public class CompWrapper extends OrganizationWrapper {
private CompService getCompService(User user) {
return ServiceUtil.getService(CompServiceImpl.class, user);
}
/**
* 列表
*
* @param params
* @return
*/
public Map<String, Object> listPage(CompSearchParam params) {
return getCompService(user).listPage(params);
}
/**
* 保存公司/分部基础信息
*
* @param params
* @return
*/
@Log(operateType = OperateTypeEnum.ADD, operateDesc = "新增分部", operateModule = LogModuleNameEnum.COMPANY)
public Long saveBaseComp(Map<String, Object> params) {
Long companyId = getCompService(user).saveBaseComp(params);
writeOperateLog(new Object() {
}.getClass(), "新增分部【" + JSON.toJSONString(params) + "】");
return companyId;
}
/**
* 更新禁用标记
*
* @param params
*/
@Log(operateType = OperateTypeEnum.UPDATE, operateDesc = "更新分部禁用标识", operateModule = LogModuleNameEnum.COMPANY)
public int updateForbiddenTagById(CompSearchParam params) {
int updateForbiddenTagById = getCompService(user).updateForbiddenTagById(params);
writeOperateLog(new Object() {
}.getClass(), "更新分部禁用标识【" + JSON.toJSONString(params) + "】");
return updateForbiddenTagById;
}
/**
* 更新分部主表、拓展表、明细表
*
* @param params
* @return
*/
@Log(operateType = OperateTypeEnum.UPDATE, operateDesc = "更新分部信息", operateModule = LogModuleNameEnum.COMPANY)
public Long updateComp(Map<String, Object> params) {
Long companyId = getCompService(user).updateComp(params);
writeOperateLog(new Object() {
}.getClass(), "更新分部信息【" + JSON.toJSONString(params) + "】");
return companyId;
}
/**
* 根据ID批量删除
*
* @param ids
*/
@Log(operateType = OperateTypeEnum.DELETE, operateDesc = "删除分部信息", operateModule = LogModuleNameEnum.COMPANY)
public int deleteByIds(Collection<Long> ids) {
int deleteByIds = getCompService(user).deleteByIds(ids);
writeOperateLog(new Object() {
}.getClass(), "删除分部信息删除数据ID【" + JSON.toJSONString(ids) + "】");
return deleteByIds;
}
/**
* 转移分部
*
* @param moveParam
* @return
*/
@Log(operateType = OperateTypeEnum.UPDATE, operateDesc = "转移分部", operateModule = LogModuleNameEnum.COMPANY)
public int moveCompany(DepartmentMoveParam moveParam) {
int moveCompany = getCompService(user).moveCompany(moveParam);
writeOperateLog(new Object() {
}.getClass(), "转移分部,分部ID【" + moveParam.getId() + "】,目标分部ID【" + moveParam.getCompany() + "】");
return moveCompany;
}
/**
* 获取搜索条件
*
* @param params
* @return
*/
public Map<String, Object> getSearchCondition(Map<String, Object> params) {
return getCompService(user).getSearchCondition(params);
}
/**
* 获取列表页面按钮信息
*
* @return
*/
public Map<String, Object> getHasRight() {
return getCompService(user).getHasRight();
}
/**
* 获取基本信息表单
*
* @param params
* @return
*/
public Map<String, Object> getCompBaseForm(Map<String, Object> params) {
return getCompService(user).getCompBaseForm(params);
}
/**
* 新增表单
*
* @return
*/
public Map<String, Object> getCompSaveForm() {
return getCompService(user).getCompSaveForm();
}
/**
* 获取转移表单
*
* @return
*/
public List<SearchConditionGroup> getMoveForm() {
return getCompService(user).getMoveForm();
}
}