weaver-hrm-organization/src/com/engine/organization/wrapper/PostInfoWrapper.java

137 lines
4.5 KiB
Java
Raw Normal View History

2022-05-13 16:05:10 +08:00
package com.engine.organization.wrapper;
2022-07-05 15:15:00 +08:00
import com.alibaba.fastjson.JSON;
2022-05-13 16:05:10 +08:00
import com.engine.common.util.ServiceUtil;
2022-07-05 15:15:00 +08:00
import com.engine.organization.annotation.Log;
2022-05-30 18:40:25 +08:00
import com.engine.organization.entity.postion.param.PostInfoSearchParam;
2022-07-07 14:19:56 +08:00
import com.engine.organization.entity.postion.po.PostInfoPO;
2022-07-05 15:15:00 +08:00
import com.engine.organization.enums.LogModuleNameEnum;
import com.engine.organization.enums.OperateTypeEnum;
2022-07-07 14:19:56 +08:00
import com.engine.organization.mapper.post.PostInfoMapper;
2022-05-13 16:05:10 +08:00
import com.engine.organization.service.PostInfoService;
import com.engine.organization.service.impl.PostInfoServiceImpl;
2022-07-05 15:15:00 +08:00
import com.engine.organization.util.OrganizationWrapper;
2022-07-07 14:19:56 +08:00
import com.engine.organization.util.db.MapperProxyFactory;
2022-05-13 16:05:10 +08:00
import weaver.hrm.User;
import java.util.Collection;
2022-07-07 14:19:56 +08:00
import java.util.List;
2022-05-13 16:05:10 +08:00
import java.util.Map;
/**
2022-06-14 11:07:48 +08:00
* @description:
2022-05-13 16:05:10 +08:00
* @author:dxfeng
* @createTime: 2022/05/13
* @version: 1.0
*/
2022-07-05 15:15:00 +08:00
public class PostInfoWrapper extends OrganizationWrapper {
2022-05-13 16:05:10 +08:00
private PostInfoService getPostInfoService(User user) {
return ServiceUtil.getService(PostInfoServiceImpl.class, user);
}
2022-07-07 14:19:56 +08:00
private PostInfoMapper getPostInfoMapper() {
return MapperProxyFactory.getProxy(PostInfoMapper.class);
}
2022-05-13 16:05:10 +08:00
/**
* 职务信息列表
*
* @param params
* @return
*/
public Map<String, Object> listPage(Map<String, Object> params) {
return getPostInfoService(user).listPage(params);
}
/**
* 新增职务信息
*
* @param param
* @return
*/
2022-07-05 15:15:00 +08:00
@Log(operateType = OperateTypeEnum.ADD, operateModule = LogModuleNameEnum.POSTINFO, operateDesc = "新增职务信息")
2022-05-13 16:05:10 +08:00
public int savePostInfo(PostInfoSearchParam param) {
2022-07-05 15:15:00 +08:00
int savePostInfo = getPostInfoService(user).savePostInfo(param);
writeOperateLog(new Object() {
2022-07-07 14:19:56 +08:00
}.getClass(), param.getPostInfoName(), JSON.toJSONString(param), "新增职务信息");
2022-07-05 15:15:00 +08:00
return savePostInfo;
2022-05-13 16:05:10 +08:00
}
/**
* 更新职务信息
*
* @param param
* @return
*/
2022-07-05 15:15:00 +08:00
@Log(operateType = OperateTypeEnum.UPDATE, operateModule = LogModuleNameEnum.POSTINFO, operateDesc = "更新职务信息")
2022-05-13 16:05:10 +08:00
public int updatePostInfo(PostInfoSearchParam param) {
2022-07-07 14:19:56 +08:00
PostInfoPO postInfoByID = getPostInfoMapper().getPostInfoByID(param.getId());
2022-07-05 15:15:00 +08:00
int updatePostInfo = getPostInfoService(user).updatePostInfo(param);
writeOperateLog(new Object() {
2022-07-07 14:19:56 +08:00
}.getClass(), postInfoByID.getPostInfoName(), JSON.toJSONString(param), postInfoByID, getPostInfoMapper().getPostInfoByID(param.getId()));
2022-07-05 15:15:00 +08:00
return updatePostInfo;
2022-05-13 16:05:10 +08:00
}
/**
* 更新禁用标记
*
* @param params
*/
2022-07-05 15:15:00 +08:00
@Log(operateType = OperateTypeEnum.UPDATE, operateModule = LogModuleNameEnum.POSTINFO, operateDesc = "更新职务信息禁用标识")
public int updateForbiddenTagById(PostInfoSearchParam params) {
2022-07-07 14:19:56 +08:00
PostInfoPO postInfoByID = getPostInfoMapper().getPostInfoByID(params.getId());
2022-07-05 15:15:00 +08:00
int updateForbiddenTagById = getPostInfoService(user).updateForbiddenTagById(params);
writeOperateLog(new Object() {
2022-07-07 14:19:56 +08:00
}.getClass(), postInfoByID.getPostInfoName(), JSON.toJSONString(params), postInfoByID, getPostInfoMapper().getPostInfoByID(params.getId()));
2022-07-05 15:15:00 +08:00
return updateForbiddenTagById;
}
2022-05-13 16:05:10 +08:00
/**
* 根据ID批量删除
*
* @param ids
*/
2022-07-05 15:15:00 +08:00
@Log(operateType = OperateTypeEnum.DELETE, operateModule = LogModuleNameEnum.POSTINFO, operateDesc = "删除职务信息")
2022-07-07 14:19:56 +08:00
public int deleteByIds(Collection<Long> ids) {
List<PostInfoPO> postInfoPOS = getPostInfoMapper().getPostInfosByIds(ids);
2022-07-05 15:15:00 +08:00
int deleteByIds = getPostInfoService(user).deleteByIds(ids);
2022-07-07 14:19:56 +08:00
for (PostInfoPO postInfoPO : postInfoPOS) {
writeOperateLog(new Object() {
}.getClass(), postInfoPO.getPostInfoName(), JSON.toJSONString(ids), "删除职务信息");
}
2022-07-05 15:15:00 +08:00
return deleteByIds;
2022-05-13 16:05:10 +08:00
}
/**
* 获取搜索条件
*
* @param params
* @return
*/
public Map<String, Object> getSearchCondition(Map<String, Object> params) {
return getPostInfoService(user).getSearchCondition(params);
}
/**
* 获取新增表单
*
* @param params
* @return
*/
public Map<String, Object> getPostInfoForm(Map<String, Object> params) {
return getPostInfoService(user).getPostInfoForm(params);
}
/**
* 获取列表页面按钮信息
*
* @return
*/
public Map<String, Object> getHasRight() {
return getPostInfoService(user).getHasRight();
}
}