|
@@ -1,30 +1,23 @@
|
|
|
package org.dromara.system.service.impl;
|
|
package org.dromara.system.service.impl;
|
|
|
|
|
|
|
|
-import cn.hutool.core.convert.Convert;
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
-import org.dromara.common.core.constant.CacheNames;
|
|
|
|
|
|
|
+import lombok.RequiredArgsConstructor;
|
|
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.dromara.common.core.utils.MapstructUtils;
|
|
import org.dromara.common.core.utils.MapstructUtils;
|
|
|
import org.dromara.common.core.utils.ObjectUtils;
|
|
import org.dromara.common.core.utils.ObjectUtils;
|
|
|
-import org.dromara.common.core.utils.SpringUtils;
|
|
|
|
|
import org.dromara.common.core.utils.StringUtils;
|
|
import org.dromara.common.core.utils.StringUtils;
|
|
|
-import org.dromara.common.mybatis.core.page.TableDataInfo;
|
|
|
|
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
|
import org.dromara.common.mybatis.core.page.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 lombok.extern.slf4j.Slf4j;
|
|
|
|
|
-import org.dromara.system.domain.ComDept;
|
|
|
|
|
-import org.dromara.system.domain.SysDept;
|
|
|
|
|
-import org.dromara.system.domain.vo.SysDeptVo;
|
|
|
|
|
-import org.springframework.cache.annotation.Cacheable;
|
|
|
|
|
-import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
+import org.dromara.common.mybatis.core.page.TableDataInfo;
|
|
|
|
|
+import org.dromara.system.domain.ErpDept;
|
|
|
import org.dromara.system.domain.bo.ErpDeptBo;
|
|
import org.dromara.system.domain.bo.ErpDeptBo;
|
|
|
import org.dromara.system.domain.vo.ErpDeptVo;
|
|
import org.dromara.system.domain.vo.ErpDeptVo;
|
|
|
-import org.dromara.system.domain.ErpDept;
|
|
|
|
|
import org.dromara.system.mapper.ErpDeptMapper;
|
|
import org.dromara.system.mapper.ErpDeptMapper;
|
|
|
import org.dromara.system.service.IErpDeptService;
|
|
import org.dromara.system.service.IErpDeptService;
|
|
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
|
|
|
@@ -66,6 +59,12 @@ public class ErpDeptServiceImpl extends ServiceImpl<ErpDeptMapper, ErpDept> impl
|
|
|
return TableDataInfo.build(result);
|
|
return TableDataInfo.build(result);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public List<ErpDeptVo> selectDeptList(ErpDeptBo dept) {
|
|
|
|
|
+ LambdaQueryWrapper<ErpDept> lqw = buildQueryWrapper(dept);
|
|
|
|
|
+ return baseMapper.selectDeptList(lqw);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 查询符合条件的erp部门列表
|
|
* 查询符合条件的erp部门列表
|
|
|
*
|
|
*
|
|
@@ -177,6 +176,22 @@ public class ErpDeptServiceImpl extends ServiceImpl<ErpDeptMapper, ErpDept> impl
|
|
|
return dept;
|
|
return dept;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 校验部门名称是否唯一
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param dept 部门信息
|
|
|
|
|
+ * @return 结果
|
|
|
|
|
+ */
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public boolean checkDeptNameUnique(ErpDeptBo dept) {
|
|
|
|
|
+ boolean exist = baseMapper.exists(new LambdaQueryWrapper<ErpDept>()
|
|
|
|
|
+ .eq(ErpDept::getDeptName, dept.getDeptName())
|
|
|
|
|
+ .eq(ErpDept::getParentId, dept.getParentId())
|
|
|
|
|
+ .eq(ErpDept::getPlatformCode, dept.getPlatformCode())
|
|
|
|
|
+ .ne(ObjectUtil.isNotNull(dept.getDeptId()), ErpDept::getDeptId, dept.getDeptId()));
|
|
|
|
|
+ return !exist;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 保存前的数据校验
|
|
* 保存前的数据校验
|
|
|
*/
|
|
*/
|