feat(oa): 新增运营中心制度管理功能
- 新增运营中心制度管理的实体类、VO、BO及Mapper接口 - 实现制度管理的增删改查及分页查询功能 - 提供制度信息的Excel导出功能- 配置MyBatis Plus的逻辑删除支持 - 添加制度管理的校验与业务逻辑处理 - 实现制度管理前端控制器接口 - 支持制度类别、名称等内容的条件查询 - 完成制度信息的数据转换与参数校验 - 设置制度管理模块的基础权限控制- 集成制度信息导入导出工具类支持
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
package com.ruoyi.oa.service;
|
||||
|
||||
import com.ruoyi.oa.domain.OaOperationRule;
|
||||
import com.ruoyi.oa.domain.vo.OaOperationRuleVo;
|
||||
import com.ruoyi.oa.domain.bo.OaOperationRuleBo;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 运营中心制度管理Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-10-22
|
||||
*/
|
||||
public interface IOaOperationRuleService {
|
||||
|
||||
/**
|
||||
* 查询运营中心制度管理
|
||||
*/
|
||||
OaOperationRuleVo queryById(Long ruleId);
|
||||
|
||||
/**
|
||||
* 查询运营中心制度管理列表
|
||||
*/
|
||||
TableDataInfo<OaOperationRuleVo> queryPageList(OaOperationRuleBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询运营中心制度管理列表
|
||||
*/
|
||||
List<OaOperationRuleVo> queryList(OaOperationRuleBo bo);
|
||||
|
||||
/**
|
||||
* 新增运营中心制度管理
|
||||
*/
|
||||
Boolean insertByBo(OaOperationRuleBo bo);
|
||||
|
||||
/**
|
||||
* 修改运营中心制度管理
|
||||
*/
|
||||
Boolean updateByBo(OaOperationRuleBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除运营中心制度管理信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
package com.ruoyi.oa.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.oa.domain.bo.OaOperationRuleBo;
|
||||
import com.ruoyi.oa.domain.vo.OaOperationRuleVo;
|
||||
import com.ruoyi.oa.domain.OaOperationRule;
|
||||
import com.ruoyi.oa.mapper.OaOperationRuleMapper;
|
||||
import com.ruoyi.oa.service.IOaOperationRuleService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 运营中心制度管理Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-10-22
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class OaOperationRuleServiceImpl implements IOaOperationRuleService {
|
||||
|
||||
private final OaOperationRuleMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询运营中心制度管理
|
||||
*/
|
||||
@Override
|
||||
public OaOperationRuleVo queryById(Long ruleId){
|
||||
return baseMapper.selectVoById(ruleId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询运营中心制度管理列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<OaOperationRuleVo> queryPageList(OaOperationRuleBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<OaOperationRule> lqw = buildQueryWrapper(bo);
|
||||
Page<OaOperationRuleVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询运营中心制度管理列表
|
||||
*/
|
||||
@Override
|
||||
public List<OaOperationRuleVo> queryList(OaOperationRuleBo bo) {
|
||||
LambdaQueryWrapper<OaOperationRule> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<OaOperationRule> buildQueryWrapper(OaOperationRuleBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<OaOperationRule> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getRuleCategory()), OaOperationRule::getRuleCategory, bo.getRuleCategory());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getRuleName()), OaOperationRule::getRuleName, bo.getRuleName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getCoverage()), OaOperationRule::getCoverage, bo.getCoverage());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getResponsibleDepartment()), OaOperationRule::getResponsibleDepartment, bo.getResponsibleDepartment());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getAccessory()), OaOperationRule::getAccessory, bo.getAccessory());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增运营中心制度管理
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(OaOperationRuleBo bo) {
|
||||
OaOperationRule add = BeanUtil.toBean(bo, OaOperationRule.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setRuleId(add.getRuleId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改运营中心制度管理
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(OaOperationRuleBo bo) {
|
||||
OaOperationRule update = BeanUtil.toBean(bo, OaOperationRule.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(OaOperationRule entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除运营中心制度管理
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user